|
Setting Y axis range through JSChartViewer? |
Posted by Tyrone on Aug-08-2013 14:27 |
|
I am making graph using "Zoom scroll with tracking line" as template, but seems I can't find any way to adjust Y axis scaling from Javascript side. Looking here http://www.advsofteng.com/doc/cdcomdoc/JsChartViewer.htm , but still having no clue. |
Re: Setting Y axis range through JSChartViewer? |
Posted by Peter Kwan on Aug-08-2013 22:43 |
|
Hi Tyrone,
The "Zooming and Scrolling with Track Line" example includes code to adjust the x-axis scale using Javascript (the "setTimeRange" Javscript function). The code is just to set the x-axis scale when the user clicks the "Last XXX days" link.
Setting the y-axis scale is almost exactly the same. You just need to use setViewPortHeight and setViewPortTop to configure the vertical view port you want to use, and then call "raiseViewPortChangedEvent" to update the chart. You may use getValueAtViewPort to determine the view port position given a y data value.
Hope this can help.
Regards
Peter Kwan |
|