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.
Default: “dataPoint1”, “dataPoint2”..var chart = new CanvasJS.Chart("container", { . . data:[ { dataPoints: [ {x: 10 , y: 50 , legendText: "Apple" }, ], }, ] . . }); chart.render();
Also See:
Comment
There is a typo : “{ y: 8, name: “Grapes”, legnedText: “grapes” },”
Should be legendText