隐藏轴线和网格线

我试图隐藏轴线和网格线我的高图表完全。 到目前为止,我已经尝试将行的宽度设置为0,但是没有成功。

xAxis: {
lineWidth: 0,
minorGridLineWidth: 0,
lineColor: 'transparent'
}

是否有可能仅仅全局禁用轴线/刻度和网格线来创建一个“平面”图?

126878 次浏览

Just add

xAxis: {
...
lineWidth: 0,
minorGridLineWidth: 0,
lineColor: 'transparent',
...
labels: {
enabled: false
},
minorTickLength: 0,
tickLength: 0
}

to the xAxis definition.

Since Version 4.1.9 you can simply use the axis attribute visible:

xAxis: {
visible: false,
}

For the yAxis you'll also need:

gridLineColor: 'transparent',

you can also hide the gridline on yAxis as:

yAxis:{
gridLineWidth: 0,
minorGridLineWidth: 0
}

i managed to turn off mine with just

       lineColor: 'transparent',
tickLength: 0

If you doesn't want to touch the config object, you just hide the grid by css:

.chart-container .highcharts-grid {
display: none;
}

If you have bigger version than v4.9 of Highcharts you can use visible: false in the xAxis and yAxis settings.

Example:

$('#container').highcharts({


chart: {
type: 'column'
},


title: {
text: 'Highcharts axis visibility'
},


xAxis: {
visible: false
},


yAxis: {
title: {
text: 'Fruit'
},
visible: false
}


});

This has always worked well for me:

yAxes: [{
ticks: {
display: false;
},