Sets the indexLabel of individual dataPoint. indexLabel set here overrides indexLabel set from dataSeries level(if any). “indexLabel” can either be string literal or keyword. keywords are property names mentioned inside curly braces.
Instead of setting string values , you can also use keywords like x, y, etc that will automatically show corresponding properties as indexLabel. While setting indexLabel you specify a keyword by enclosing it in flower brackets like {x}, {y}, {color}, etc.
Range Charts have two indexLabels – one for each y value. This requires the use of a special keyword #index to show index label on either sides of the column/bar/area.
eg: indexLabel: “{x}: {y[#index]}”
In case of stacked, pie and doughnut charts you can also use special keywords like #percent & #total
eg: indexLabel: “#percent”
Important keywords to keep in mind are. {x}, {y}, {name}, {label}.
Default: nullvar chart = new CanvasJS.Chart("container", { . . data: [{ dataPoints: [ { x: 10, y: 10, indexLabel: "high" }, ], }, ] . . }); chart.render();
Also See: