Home forums Using CanvasJS How to use viewport on dates

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

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #11523

    mitul
    Member

    I have a column chart displaying units of electricity used every day on the y axis and the date in dd-mm-yy format on x axis. The data logger sends in all the data at once(for the whole year). So i have a very cluttered chart which i need to zoom manually to see properly. How can I zoom it in program to view only the last months data and then pan left to view the remaining dates?

    #11524

    Vishwas R
    Keymaster

    Mitul,

    You can use viewportMinimum and/or viewportMaximum to zoom to a specific region by default or to handle zooming programmatically.

    #11525

    mitul
    Member

    Thanks for the reply. But can you please tell me how to use viewportminimum/maximum with dates. Suppose i want to display only the current months data from a total dataset of the whole year. The date format displayed on x axis is dd-mm-yy.

    #11532

    Vishwas R
    Keymaster

    Mitul,

    You can set viewportMinimum to one month less than the last dataPoint. Here is an example.

    #11534

    mitul
    Member

    Thanks Vishwas. Will try it out.

    #11535

    mitul
    Member

    Works great. Thanks.

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

You must be logged in to reply to this topic.