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

Message ListMessage List     Post MessagePost Message

  Zooming from the right most side.
Posted by Shiwan Sung on Dec-08-2016 15:06
Hi!
I'm developing an application using the finance chart.
I want to zoom the chart from the right most using the mouse wheel.
But the problem is that when I zooming the chart, it is zooming from the point under the mouse point.
How can I zoom the chart from the right most data(the latest data) not the point under the mouse.
Thank you in advance.

  Re: Zooming from the right most side.
Posted by Peter Kwan on Dec-08-2016 23:13
Hi Shiwan,

You can always change the viewport left side so that the right side is always at the latest data. The exact code depends on your programming language and whether you are writing a web or desktop application. As an example, in C# for a Windows Forms application, you can add the following code in the ViewPortChanged event handler:

// The right side will always be 1, so the left side must be 1 - width.
winChartViewer1.ViewPortLeft = 1 - winChartViewer1.ViewPortWidth;

If you need further help, would you mind to inform me of your programming language and whether it is a web or desktop application?

Regards
Peter Kwan

  Re: Zooming from the right most side.
Posted by Shiwan Sung on Dec-09-2016 14:53
Thank you very much.
It was a great help for me.