How to remove “Values” and “series” from highcharts?

∥☆過路亽.° 提交于 2020-02-23 09:47:06

问题


I'm using highcharts on my website, which looks great, but I now want to remove these two labels from the chart:

I tried disabling all sorts of labels, such as this one:

{
    title: {
        text: 'X axis labels are disabled'
    },
    xAxis: {
        labels: {
            enabled: false
        }
    },

    series: [{
        data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
    }]
}

but I can't find a way to remove these specifically.

Here is the fiddle of the image above.

Does anybody know how I can remove these labels?


回答1:


The "Values" is the title of the y-axis. It can be disabled like this:

yAxis: {
    title: {
        text: null
    }
}

or

yAxis: {
    title: false
}

The "Series 1" is part of the legend. It can be disabled like this:

legend: {
    enabled: false
}

Or alternatively disable a specific series from being shown in the legend, like this:

series: [{
    showInLegend: false,
    data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5]
}]

See this updated JSFiddle for a live demonstration.



来源:https://stackoverflow.com/questions/35542397/how-to-remove-values-and-series-from-highcharts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!