name: String

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

Default: Automatically Named
Example: “series 1”, “data1” ..
Note
  • If not provided, they are automatically named based on the order in which they are added. e.g. dataSeries1, dataSeries2 and so on.
var  chart =  new  CanvasJS.Chart("container",
{
 .
 .
 data: [{
   name: "year 2005",
  }],
 .
 . 
});
chart.render();

Try Editing The Code

  Also See:    


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

2 Comments

  1. Amer says:

    Hello,

    Is there any workaround to add line break to the name as we add in toolTip?

    I tried and \n but they don’t work.

    Thanks

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