Home forums Using CanvasJS Y axis range & Zoom Functionality

This topic contains 4 replies, has 2 voices, and was last updated by  Anjali 2 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7011

    SwapnilV007
    Participant

    Hi,

    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?

    Thanks,
    Swapnil

    #7020

    Anjali
    Participant

    Hi,

    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.


    Anjali

    #7176

    SwapnilV007
    Participant

    Hi,

    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.

    Thanks,
    Swapnil

    #7188

    SwapnilV007
    Participant

    Hi,

    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.

    Thanks,
    Swapnil

    #7192

    Anjali
    Participant

    Swapnil,

    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.


    Anjali

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.