问题
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