Home › forums › Using CanvasJS › Y axis range & Zoom Functionality
This topic contains 4 replies, has 2 voices, and was last updated by Anjali 4 years, 1 month ago.
I want to have fixed Ymin and Ymax values for Y axis.
But if there is a data point that has value less than Y min or Greater than Y max; then I will try to zoom that portion of graph and expect the Y axis scale to change when zoomed as per the value of that datapoint. But the Yaxis scale remains same even when zoomed. Is there any way to change the scale when zoomed?
Only way to keep Axis Y range dynamic is by not setting the minimum and maximum value of axis. Axis does not override user defined values even while zooming.
I tried below mentioned API that can be used to change Y-min and Y-max when zooming:
chart.options.axisY.minimum = null;
chart.options.axisY.maximum = null;
When I dont set the minimum and maximum values of Y axis then graph automatically calculates the min and max values depending on the zoomed portion. That means it has this intelligence built in to decide the min and max values depending on zoomed portion.
Can I get these values and directly use these returned values in above mentioned api’s so that zooming scales the Y axis.
Currently It is able to scale Y axis when zoomed but as I am passing “null” value to above API’s; the scaling range is always -5 to 5.
Just wanted to know if this is possible with current version and If not then how much efforts will it need to add such support.
We have just released v1.9.6 Beta with Methods & Properties, which allows you to programmatically export chart as image, print chart, access internally calculated values, etc. Please refer to the release blog for more information.
We currently don’t have a way to access minimum and maximum values that are auto calculated. At the same time we think the chart should not override the values initially set by the user while zooming – which defeats the purpose of setting minimum and maximum (by users). Hence we don’t intend to implement the same.
You must be logged in to reply to this topic.