Home Forums Chart Support Set Axis X granularity

Set Axis X granularity

Viewing 4 posts - 1 through 4 (of 4 total)
  • #24313

    Hi,
    Congratulations for this nice work.
    Please i’d like to set the time in a granularity of 5mins like (11:10:00 11:15:00 …)
    How can i make it please ?

    #24319

    @uriel,

    You can achieve the above requirement by setting the valueFormatString as “hh:mm:ss”, intervalType as “minute” and interval to 5 for Axis X.

    ____
    Shashi Ranjan
    Team CanvasJS

    #24325

    Thanks Ranjan,
    I’ve even made it work, with the same solution.
    the problem now, is that the date format i want to display (‘YYYY-MMM-DD hh:mm:ss’) doesn’t apply<
    I still come out with the hh:mm:ss.
    down i post a peace of code:

    `var chart = new CanvasJS.Chart(“chartContainer”, {
    zoomEnabled: true,
    title: {
    text: “Nombre de Sites HS”
    },
    axisX: {
    title: “chart updates every 5 mins”,// + updateInterval / 10000 + ” mins”,
    intervalType: “minute”,
    ValueFormatString: “YYYY-MMM-DD hh:mm:ss”,
    interval: 5
    },
    axisY:{
    suffix: ” “,
    includeZero: false
    },
    toolTip: {
    shared: true
    },`

    Thanks for your support

    #24337

    @uriel,

    valueFormatString defines how values must be formatted before they appear on Axis X. Changing ValueFormatString to valueFormatString should work fine in your case.


    Vishwas R
    Team CanvasJS

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

You must be logged in to reply to this topic.