Home Forums Chart Support XAxis Labels with Date only (no timestamp)

XAxis Labels with Date only (no timestamp)

Viewing 2 posts - 1 through 2 (of 2 total)
  • #34527

    I have a chart I want to show values by day only. But, if the sample is small, the chart auto-magically spreads out to show full timestamp (date + time). I don’t want the time to show ever, only the date.
    Is there a way to do that other than creating my own XAxis as a ‘label’ type?

    #34542

    @jeffe,

    You can use valueFormatString property to define how X-axis labels must be formatted before they appear. Please take a look at this code-snippet for an example on showing only date as the labels,

    axisX:{      
       valueFormatString: "DD-MMM" ,
    }, 

    Kindly, take a look at this JSFiddle for an example on the same.

    date time formatting using valueFormatString property


    Adithya Menon
    Team CanvasJS

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

You must be logged in to reply to this topic.