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

This topic contains 3 replies, has 2 voices, and was last updated by  Vishwas R 3 weeks, 3 days ago.

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

    leandrocosta
    Member

    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

    Vishwas R
    Keymaster

    @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

    leandrocosta
    Member

    Thanks a lot!

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

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

    #22719

    Vishwas R
    Keymaster

    @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.