Legend text is a textual description of what is represented by each of the dataPoints. The name of dataPoint is taken as a default value, which could be overwritten by custom text by setting this property.
legendText can also contain keywords inside the string. Keywords are property names mentioned inside curly braces like “{name}”, “{x}: {y}”, etc. legendText can either be string or keywords. keywords are property names mentioned inside curly braces.
var chart = new CanvasJS.Chart("container", { . . data:[ { dataPoints: [ {x: 10 , y: 50 , legendText: "Apple" }, ], }, ] . . }); chart.render();
Also See:
Comment
Server Side Technologies |
Front End Technologies |
Contact |
|
---|---|---|---|
ASP.NET MVC Charts | JavaScript Charts | FAQs | |
PHP Charts | jQuery Charts | Sales Enquiries | |
Spring MVC Charts | React Charts | Support Forum | |
JSP Charts | Angular Charts | Careers | |
JavaScript StockCharts | |||
Privacy Policy © fenopix
There is a typo : “{ y: 8, name: “Grapes”, legnedText: “grapes” },”
Should be legendText