Setting this property to true makes the dataSeries to appear in legend. In case of pie/ doughnut chart, dataPoints of the single series chart appear in legend.
Default: falsevar chart = new CanvasJS.Chart("container", { . . data: [{ showInLegend: true, }, ] . . }); chart.render();
Also See:
9 Comments
Excellent Work you are real developer !!!
Thanks Vivek… :-)
Hi!
The is a bug in Legend showing. Try to append the next code:
legend: {
cursor:”pointer”,
itemclick : function(e) {
if (typeof(e.dataSeries.visible) === “undefined” || e.dataSeries.visible) {
e.dataSeries.visible = false;
} else {
e.dataSeries.visible = true;
}
chart.render();
}
}
into the options of chart and try to click on “DataSeries 3” after that!
Michael,
We are not able to recreate the issue. Can you please create a jsfiddle so that we can take a look?
Anjali,
Tty to hide “DataSeries 3” here:
http://jsfiddle.net/MichaelGui/gyu3u5yk/
Michael,
Thanks for reporting the issue. We will fix it in the next version.
Michael,
This issue has been in the latest version – 1.6.0 Beta. Please download the same and let us know if its working as expected at your end.
Hi!
I am using canvasJS chart to render a scatter chart. In that I am using 4 different dataseries , I need to show all four legends on chart but with my own alignment . Two of them should be displayed on top right side vertical each one separate line and one of them at top of y-axis and remaining at start of x-axis . Can I able to align legend position dynamically .Please I need it as urgent as possible..
I have create a fiddler example . You can use that to help me out. http://jsfiddle.net/7ujgrr3c/
Muhammad ,
As of now, it is not possible.