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” ..

Notes
  • 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 it Yourself by Editing the Code below.

  Also See:    



In order to provide better support,we have closed the comments and switched completely to our Forums.
If you have any questions, please feel free to ask in our forums.

Comments 2

  1. 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

In order to provide better support,we have closed the comments and switched completely to our Forums.
If you have any questions, please feel free to ask in our forums.