Home forums Using CanvasJS Zoom

Tagged: 

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

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

    Navinder
    Member

    Hi,

    I have a zoomable line graph with 7 days of data. The make it look clean I have valueFormatString: “DD-MMM” on the main screen…but when I zoom it shows no tick (which is understandable) if data zoomed is less than day.

    Is there any possibility to change valueFormatString to “DD-MMM h tt” when zoomed So, that data being shown is clear. Please let me know if you need some more info.

    Thanks

    • This topic was modified 2 months, 1 week ago by  Navinder.
    #12648

    Vishwas R
    Keymaster

    @navinder,

    Please check this jsfiddle for example.

    Also refer rangeChanging, rangeChanged, valueFormatString for more info.

    #12674

    Navinder
    Member

    Hi Vishwas,

    Thanks for that. I have data in minutes and I am using below code. Its working fine for reset but for zoom, it’s showing
    HH:11 for all minutes of hour and changes to HH+1:11 for next hour.

    var axisXOption= {
    interval: 3,
    intervalType: “hour”,
    valueFormatString: “DD-MMM h tt”,
    };
    if(e.trigger === “reset”) {
    axisXOption.interval=3;
    axisXOption.intervalType=”hour”;
    axisXOption.valueFormatString= “DD-MMM h tt”;
    }
    else if(e.trigger === “zoom”) {
    axisXOption.interval= 5;
    axisXOption.intervalType= “minute”;
    axisXOption.valueFormatString= “HH:MM”;
    }

    #12675

    Navinder
    Member

    Hi,

    It’s resolved. I was using MM instead of mm. 🙂

    Thanks for support.

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

You must be logged in to reply to this topic.