Home forums Using CanvasJS Programmatically panning chart while zoomed in

Tagged: ,

This topic contains 1 reply, has 2 voices, and was last updated by  Vishwas R 2 weeks, 5 days ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #23265

    robertlight
    Member

    Can I programmatically pan the chart when the user has zoomed into a segment of the graph?

    I want to set it so if the user is panned to the latest part of the graph and then another data element gets added to the graph, that the viewport window automatically pans rightward.

    #23276

    Vishwas R
    Keymaster

    @robertlight,

    You can programmatically zoom / pan to a region by setting viewportMinimum and viewportMaximum. In your case, you can set viewportMaximum to null (which resets the viewportMaximum) when user has zoomed / panned towards the latest dataPoint (latest part of the chart) using rangeChanged event. Please take a look at this JSFiddle.


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.