Home forums Using CanvasJS viewPort Max/Min with date value

Tagged: 

This topic contains 3 replies, has 2 voices, and was last updated by  Manoj Mohan 4 months ago.

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

    I’m building a ocean tide chart.
    I have tides for 14 days on a spline area chart.
    The issue is it shows all 14 days at once.

    I need to be able to set the default view port of the chart to one day, with the users ability to pan/scroll on xAxis (left right) to other days.

    #25159

    @saltstrong,

    You can programmatically zoom into a region by setting viewportMinimum and viewportMaximum.

    To zoom into a certain region, there should be a minimum of 3-4 dataPoints – behavior is designed such that zooming is limited upto a certain region, so the user doesn’t end up zooming into a blank-region (region with no dataPoints). Due to this restriction, it’s not possible to pan chart as you zoom into the region with just 1 dataPoint.

    ——-
    Manoj Mohan
    Team CanvasJS

    #25165

    How would you setup a zoom for a date/time value on the xAxis?

    #25172

    @saltstrong,

    You can set the viewportMinimum as viewportMinimum: new Date(2019,03,14) and viewportMaximum as viewportMaximum:new Date(2019,04,14) to achieve zooming programmatically over data/time axisX type.

    ——-
    Manoj Mohan
    Team CanvasJS

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

You must be logged in to reply to this topic.