Hello Team,
I have used your canvas js line chart every thing is working fine, I want to show Y axis label in tool tip dynamic how will i implement it
code is follow
var yLabels = [“”,”N/B”,”I/G”,”A/E”];
var yLabelCounter = 0;
var IL = fil;
var CW = fcw;
var HW = fhw;
var gtype = [“IL”,”HW”,”CW”];
var chart = new CanvasJS.Chart(“chartContainer”,{
title: {
text: ‘ATL’
},
subtitle: {
text: subject + ” : ” + student_name
},
axisX:{
text: “Values”,
categories: xaxis,
},
axisY:{
interval : 1,
maximum: 3,
gridThickness: 0,
labelFormatter: function ( e ) {
var yCats = yLabels[yLabelCounter++];
if(yLabelCounter === yLabels.length)
yLabelCounter = 0;
return yCats;
}
},
toolTip:{
shared: true
},
legend: {
horizontalAlign: “right”, // “center” , “right”
verticalAlign: “center”, // “top” , “bottom”
fontSize: 15,
itemclick: toggleDataSeries
},
data: [
{
type: “line”,
name: “IL”,
showInLegend: true,
dataPoints : IL
},
{
type: “line”,
name: “HW”,
showInLegend: true,
dataPoints : HW
},
{
type: “line”,
name: “CW”,
showInLegend: true,
dataPoints : CW
}
]