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” ..etcvar chart = new CanvasJS.Chart("container", { . . data:[{ legendText: "2005", }, ] . . }); chart.render();
Also See:
7 Comments
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 .
Is it possible to change the font of the legendText?
yes you can, please refer to this link. Here you can find how to change fontColor, fontSize,fontFamily, fontStyle, etc. features for legend.
Thanks!!
Can you make a link of the legend?
Arno,
Yes you can make a link of legend and redirect it by using itemclick method as shown in this example.