Home Forums Chart Support line chart

line chart

Viewing 2 posts - 1 through 2 (of 2 total)
  • #27079

    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
    }
    ]

    #27098

    @hiren-garasia,

    Can you kindly share JSFiddle along with sample data so that we can look into the code, understand the scenario better and help you out?


    Shashi Ranjan
    Team CanvasJS

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.