ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Partial Update on JsViewPortControl
Posted by Robert on Sep-29-2016 12:05
Hi,

I have been using the JsChartViewer.partialUpdate in one of our web application for years.

A few days ago I found out there is a new JsViewPortControl on CD v6 which is a very cool feature and I'm trying to integrate this into our web application.

Everything worked as expected the only problem I have at the moment is that it does not  seems to support partialUpdate which means when user changed one of the graph settings and partial updated the main chart. The same change won't be reflected on the ViewPortControl.

I know I might be able to work around this by manually AJAX update the JsViewPortControl. But before I go down that path I just want to check with you that I'm not missing anything obvious here.

Regards

Robert

  Re: Partial Update on JsViewPortControl
Posted by Peter Kwan on Sep-30-2016 02:09
Hi Robert,

Internally, the WebViewPortControl (or ViewPortControl depending on which programming language edition of ChartDirector you are using) is just a specially configured WebChartViewer, so it should support most of the WebChartViewer features, including partialUpdate.

However, because we have not tested in detail all the operation modes of WebViewPortControl, and there is no sample code that demonstrate partialUpdate on the WebViewPortControl, so we do not claim it can support partialUpdate.

Today, I tested myself using the .NET edition of ChartDirector, and it works in my case.

On the browser side, I just use JsChartViewer for the WebViewPortControl for partialUpdate. It is like "JsChartViewer.get(id).partialUpdate();", where id is that of the WebViewPotrControl.

On the server side, the WebChartViewer.GetSenderClientId can be used to determine the real WebChartViewer or the WebViewPortControl is sending the partialUpdate request. The code can then update the chart accordingly.

Regards
Peter Kwan

  Re: Partial Update on JsViewPortControl
Posted by Robert on Oct-03-2016 11:35
Hi Peter,

Thanks. It worked!

My only issue at the moment is that if I resize the ViewPortControl's image using partialUpdate the view port border on the JsViewPortControl (the square that highlights the current view port) become incorrect.

It looks like some internal dimensions in JsViewPortControl did not get updated automatically after the resizing.

I tried to reset the viewer to the viewport control with the following code after the partialUpdate but it does not fix the problem:
JsViewPortControl.get('<%=WebViewPortControl1.ClientID%>').setViewer(viewer);

Any help will be appreciated.

Regards

Robert

  Re: Partial Update on JsViewPortControl
Posted by Peter Kwan on Oct-04-2016 02:25
Hi Robert,

Unluckily, currently the only method to reset the viewport control is to remove the HTML tag (an <IMG> tag) that represents the viewport control. The "JsViewPortControl.get" will get an existing instance of the viewport control if there is one and will not reset it. We usually suggest people to reload the web page if the viewport control needs to be updated.

Regards
Peter Kwan

  Re: Partial Update on JsViewPortControl
Posted by Robert on Oct-04-2016 04:33
Hi Peter,

The graph page I'm working on always try to best fit the graph to the user's browser window size.

I was hoping I can do the same with the new viewport control.

Reloading/server postback is my last option since it will make the page less responsive.

Overall the viewport control worked really well with partialUpdate.

Thanks you for your help.

Regards

Robert

  Re: Partial Update on JsViewPortControl
Posted by Peter Kwan on Oct-04-2016 16:18
Hi Robert,

Our developer has updated the cdjcv.js and it seems to allow the JsViewPortControl to resize in a partialUpdate. May be you can try to see if it works in your case. It is at:

http://www.advsofteng.com/cdjcv601.zip

Regards
Peter Kwan

  Re: Partial Update on JsViewPortControl
Posted by Robert on Oct-05-2016 06:49
Worked perfectly!

You guys are awesome :-)

Cheers

Robert

  Re: Partial Update on JsViewPortControl
Posted by Robert on Feb-01-2018 05:05
Hi Peter,

Sorry to revive this old thread.

Just want to check if this change has been merged back to your main code branch?

Because we are looking into upgrade our CD library at the moment and don't want to lose this feature.

Regards

Robert

  Re: Partial Update on JsViewPortControl
Posted by Peter Kwan on Feb-01-2018 17:18
Hi Robert,

Yes, the change has already been included in the latest version of ChartDirector.

Regards
Peter Kwan