Home Forums Report Bugs Reset not working when chart is rendered already zoomed-in

Reset not working when chart is rendered already zoomed-in

Viewing 4 posts - 1 through 4 (of 4 total)
  • #22700

    http://jsfiddle.net/sokLntxv/20/

    Note that pan still works as desired (from 10 to 90), but you can’t zoom-out to the whole range.

    #22704

    @leandrocosta,

    viewportMinimum and viewportMaximum are used to programmatically zoom to a region. In this scenario, if you try to reset the range by clicking reset button it will fallback to the range that you have set (viewportMinimum and viewportMaximum). Removing viewportMinimum and viewportMaximum should work fine in this case. Or if you are trying to zoom to a certain region on initial render and like to reset on clicking reset button, you can use rangeChanged event as shown in this updated JSFiddle.


    Vishwas R
    Team CanvasJS

    #22705

    Thanks a lot!

    Isn’it a better solution to call e.chart.render() only when trigger === “reset”?

    https://jsfiddle.net/sokLntxv/24/

    #22719

    @leandrocosta,

    Yes, its better to call e.chart.render() only on triggering reset instead of calling it everytime the range is changed :)


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.