xValueFormatString: String

Defines how x values must be formatted before they appear on the indexLabel or toolTip. You can format numbers and date time values using this property.

Notes
  • You can read more about the supported formatting options here.


var  chart =  new  CanvasJS.Chart("container",
{
 .
 .
 data: [{
   xValueFormatString: "Year ####",

  },
 ]
 .
 .
});
chart.render();


Try it Yourself by Editing the Code below.



If you have any questions, please feel free to ask in our forums.Ask Question

Comments 3

  1. It would be nice if for the presentation of the labels there would be a callback like for the mouse-over. The values here are as dynamic (MB->GB etc) as they would be in the mouseover.

  2. Hi,
    I have the timestamp in nanoseccond eg: “xcol -> 84108058.966620” or “114108058.966620” and I need to change it to HHMM, So I just changed timestamp to “84108058 or 114108058” and then I am using “Array1.push({x:parseInt(xcol),y:parseInt(ycol)});”. By using this “x:parseInt(xcol)”, I get time in format like “841 or 1,141” and I want in format like “841 or 1141” or “8:41 or 11:41” . I cannot use “label:parseInt(xcol)” for this because it change the plot appearance.
    Please help in this.
    what can we do for this ??

If you have any questions, please feel free to ask in our forums. Ask Question