Home forums Using CanvasJS Label Interval Not Working

This topic contains 2 replies, has 2 voices, and was last updated by  oneworld 5 months, 3 weeks ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #14446

    oneworld
    Member

    https://canvasjs.com/docs/charts/chart-options/axisx/intervaltype/ provides excellent examples of how to use the Interval and IntervalType properties. However those examples are limited to a static graph. When I try to apply the same approach on a dynamic scrolling graph (see JSFiddle at https://jsfiddle.net/oneworld/7s4vo1Lx/10/), those properties are completely ignored. At first I thought the reason the chart was not using my Interval settings (e.g. 3 seconds) was because of the varying number of data points that are being fed before the dynamic chart reaches the cut-off point (60 seconds in this JSFiddle example) at which I start dropping data points off the chart (for scrolling effect), but even when get past the 60 seconds mark ( past 04:25:15) my Interval settings are not being respected by the chart. After the cut-off point of 60 seconds, the number of data points in the chart is constant. Why is the XAxis labels interval different to what I supplied even after the cut-off mark? How can I use the CanvasJS Interval and IntervalType settings on a dynamic scrolling chart to control the time label intervals on an XAxis?

    #14448

    Suyash Singh
    Moderator

    @oneworld,

    interval and intervalType properties will work irrespective of the chart type – static or dynamic.

    axisX: {
        inteval: 4, // interval
        intervalType: "second"
      },

    There is a typo in your code. Please change inteval to interval and it should work fine.

    __
    Suyash Singh
    Team CanvasJS

    #14453

    oneworld
    Member

    You are absolutely right. My mistake. Thank you.

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

You must be logged in to reply to this topic.