除最外层线外,是否可以删除所有y轴网格线?
例如,在这个jsfiddle (http://jsfiddle.net/abyrne85/g7vpq8ce/1/)中,我试图删除所有的行(x轴和y轴),当然只剩下最外层的线和数据线。
$(function () {
$('#container').highcharts({
chart: {
polar: true,
type: 'line'
},
title: {
text: null,
x: -80
},
xAxis: {
categories: ['Sales', 'Marketing', 'Development', 'Customer Support','Information Technology'],
tickmarkPlacement: 'on',
lineWidth: 0
},
yAxis: {
gridLineInterpolation: 'polygon',
lineWidth: 0,
min: 0
},
legend: {
enabled:false
},
series: [{
data: [5, 3, 4, 3, 2],
pointPlacement: 'on'
}]
});
});发布于 2014-10-23 14:14:30
1.将gridLineWidthof xAxis设置为0以删除它们。
2. Set tickInterval of yAxis大于数据数组中的最大值,因此它将是唯一的网格线。
$(function () {
var myData = [5, 3, 4, 3, 2],
tickIntr = Math.max.apply(null, myData) + 1; //this is to set
//the tickInterval larger than the maximum value in data array
$('#container').highcharts({
chart: {
polar: true,
type: 'line',
},
title: {
text: null,
x: -80
},
xAxis: {
categories: ['Sales', 'Marketing', 'Development',
'Customer Support','Information Technology'],
tickmarkPlacement: 'on',
lineWidth: 0,
gridLineWidth: 0 //Remove xAxis lines
},
yAxis: {
gridLineInterpolation: 'polygon',
lineWidth: 0,
min: 0,
tickInterval: tickIntr //set yAxis tickInterval
},
legend: {
enabled:false
},
series: [{
data: myData,
pointPlacement: 'on'
}]
});
});http://jsfiddle.net/g7vpq8ce/2/
发布于 2014-10-23 15:59:37
或者使用tickPositioner,请参阅示例:http://jsfiddle.net/g7vpq8ce/3/
yAxis: {
gridLineInterpolation: 'polygon',
lineWidth: 0,
min: 0,
tickPositioner: function(min, max){
return [min, max];
}
},https://stackoverflow.com/questions/26528564
复制相似问题