name: String

Sets the dataPoint Name. dataPoint name is shown in various places like toolTip & legend unless overridden.

Default: Automatically Named (“dataPoint 1”, “dataPoint 2” .. )
Example: “apple”, “mango” ..
Notes
  • If not provided, they are automatically named based on the order in which they are added. e.g. dataPoint 1, dataPoint 2 and so on.
var  chart =  new  CanvasJS.Chart("container",
{
 .
 .
 data: [{
   dataPoints: [
     {x: 5, y: 24, name: "apple"}
  ]

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

Try Editing The Code

  Also See:    


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