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.

Note
  • You can read more about the supported formatting options here.
var  chart =  new  CanvasJS.Chart("container",
{
 .
 .
 data: [{
   xValueFormatString: "Year ####",

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

Try Editing The Code


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

3 Comments

  1. Gerhard Hoogterp says:

    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. Jitesh says:

    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