|
Auto zooming after upload graphics |
Posted by Eferov Ivan on Sep-23-2017 02:39 |
|
Hello.
Please tell me how you can automatically zoom in the graph after uploading it? And how can this be realized? The project is written in C # on the .NET platform.
Thank you in advance. |
Re: Auto zooming after upload graphics |
Posted by Peter Kwan on Sep-23-2017 18:04 |
|
Hi Eferov,
From your previous messages in this forum, it seems you are using ChartDirector for a Windows Forms application. In this case, I am not too sure what you mean by "uploading it"?
In a Windows Forms application, the application will draw the chart. When the user does something (such as to drag on rectangle on the chart), the application will handle the event and redraw the chart using the data in the selected range. This makes the chart zoom.
If you are referring to ASP.NET Web application, as in all web applications, the browser sends a request to the server. The charts are produced by code running in the server, then downloaded to the browser for display. When the user does something on the browser side (such as to drag on rectangle on the chart), the Javascript code running in the browser will will handle the event and sends a new request to the server. The server will then return an updated chart based on the user action.
If the above does not address your question, would you mind to clarify what is "uploading it"? What is "it" mean, and what does "uploading" mean? Is a web or desktop application?
Regards
Peter Kwan |
Re: Auto zooming after upload graphics |
Posted by Eferov Ivan on Sep-26-2017 00:28 |
|
and what event is responsible for scaling in your library? I need to bring the schedule, after it is rendered. |
Re: Auto zooming after upload graphics |
Posted by Peter Kwan on Sep-26-2017 04:13 |
|
Hi Eferov,
Zooming may occur when the user moves the mouse wheel, or click on the chart when the mouse is in zoom mode. When these things occur, the WinChartViewer control will generate a ViewPortChanged event. The chart should be redrawn in the ViewPortChanged event.
You may also update other things in the ViewPortChanged event. For example, in the "Zooming and Tracking with Track Line (2)" sample code, there are two "date picker" controls on the left side. See:
http://www.advsofteng.com/doc/cdnet.htm#zoomscrolltrack2.htm
When the ViewPortChanged event occur, the code also updates these controls to reflect the new axis range.
You may initiate zoom using other controls too. For example, in the "XY Zooming and Scrolling" sample code, there is a slider on the left. See:
http://www.advsofteng.com/doc/cdnet.htm#xyzoomscroll.htm
When the user moves the slider, in the event handler of the slider, the code updates the viewport, then call WinChartViewer.updateViewPort to notify ChartDirector that the viewport has been updated. ChartDirector will then raise the ViewPortChanged event, which should redraw the chart.
Regards
Peter Kwan |
|