legendText: String

Sets the text that describes the dataSeries in legend.

legendText can also contain keywords inside the string. Keywords are property names mentioned inside curly braces like “{name}”, “{x}: {y}”, etc.


Default: “DataSeries 1”, “DataSeries 2” ..etc
Example: “2010”, “2011”..

Notes
  • If legendText is not set, name property of dataSeries is taken as legendText.


var  chart =  new  CanvasJS.Chart("container",
{
 .
 .
 data:[{
  legendText: "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 7

  1. is it possible to use legend in doughnut type. Like if I want the legend to be shown in center for a doughnut chart

    • kartik,

      It is not possible yet. But we are working on this feature which you can expect by the end of next week .

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.