Home forums Using CanvasJS Set view with X axis

This topic contains 2 replies, has 2 voices, and was last updated by  Anjali 2 years, 1 month ago.

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

    TailS_tff
    Participant

    Hi everyone !

    I play some couple of day with CanvaJS, I wonderering if I could create a selectbox to pan to some default value like : Last hour, last day, last month. Yep, my X axis is datetime format.

    Thank you !

    #7215

    TailS_tff
    Participant

    well, I finally did what I want, but there is anoying things
    I set minimum and maximum like minimum : new Date (2014,….)
    It’s work, but I can’t zoom inside this selection.
    Worse, when I zoom into, 2 icons appears, but using pan icon erase all chart.
    Is there better than minimum/maximum to set prefered section, allowing to zoom in and zoom out ?

    Thank you.

    #7224

    Anjali
    Participant

    As of now setting minimum/maximum is the only way.

    I set minimum and maximum like minimum : new Date (2014,….)
    It’s work, but I can’t zoom inside this selection.

    This is a bug and we’ll fix the issue in the next release. But we do have a workaround though. Setting timestamp instead of date object works fine. Below is the code snippet.

    axisX: {
        minimum: (new Date(2002,00,1)).getTime(),
        maximum: (new Date(2002,00,20)).getTime()
    }


    Anjali Jain

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

You must be logged in to reply to this topic.