我有这张图。我有一个网格,我想在每一行插入这个图表。问题是,正如你所看到的,左边有一条小线,看起来这条线就是图形轴。我需要删除它,不仅是因为视觉方面,还因为轴增加了网格单元的高度。
提前感谢!
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="container" style="min-width: 400px; height: 100px; margin: 0 auto"></div>
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
backgroundColor: null,
renderTo: 'container',
type: 'bar',
},
title: {
text: ''
},
xAxis: {
gridLineWidth: 0,
enabled: false,
categories: [''],
labels: {
enabled: false
}
},
yAxis: {
enabled: false,
gridLineWidth: 0,
lineWidth: 0,
min: 0,
title: {
text: ''
},
labels: {
enabled: false
}
},
legend: {
enabled: false,
},
tooltip: {
formatter: function() {
return ''+
this.series.name +': '+ this.y +'';
}
},
credits:
{
enabled: false,
position:
{
align: 'left',
x: 10
}
},
plotOptions: {
series: {
stacking: 'normal'
}
},
series: [ {
name: 'Clicks',
data: [2]
}, {
name: 'Distributed Points',
data: [3]
}],
exporting:
{
enabled: false
}
});
});
发布于 2012-06-02 08:33:19

我设置了xAxis lineWidth: 0,然后在绘制完图之后:
$('.highcharts-axis').css('display','none');编辑:
如果还设置了tickWidth: 0,则可以在不使用CSS调用的情况下移除轴线的所有跟踪。
Revved fiddle here。
https://stackoverflow.com/questions/10856126
复制相似问题