Highcharts - when disabled in legend, line label s

2019-08-07 08:17发布

I am using highcharts and made this simple line chart. When I turn off the view for a person on the legend the name still appears as a line label on the line chart. Any way I can turn that off? I attached a picture of the problem. I want only Wilson to show.

This is my code:

 Highcharts.chart('chart1', {
chart: {
    type: 'line'
},
title: {
    text: 'Hours vs Month (' + months[0] + "-" + months[5] + ")"
},

xAxis: {
    categories: months
},
yAxis: {
    title: {
        text: 'Hours'
    }
},
tooltip: {
    valueSuffix: ' hours'
},
credits: {
    enabled: false
},
plotOptions: {
    series: {
        marker: {
            enabled: true
        }
    },
    line: {
        dataLabels: {
            enabled: false
        },
        enableMouseTracking: true
    }
},
series :somedata
});

enter image description here

0条回答
登录 后发表回答