我正在使用条形图(具有百分比堆叠)构建进度条,并希望删除容器中的空格/填充,并仅保留图表容器中没有任何填充/边距空间的条。
有没有办法做到这一点?
代码:
$(function () {
var chart;
$(document).ready(function () {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'bar'
},
legend: {
enabled: false,
},
title: {
text: ''
},
xAxis: {
lineWidth: 0,
labels: {
enabled: false
},
minorTickLength: 0,
tickLength: 0
},
yAxis: {
min: 0,
title: {
text: ''
},
lineWidth: 0,
gridLineWidth:0,
lineColor: 'transparent',
labels: {
enabled: false
},
minorTickLength: 0,
tickLength: 0
},
tooltip: {
enabled: false
},
plotOptions: {
bar: {
stacking: 'percent'
},
series: {
pointPadding: 0,
groupPadding: 0,
}
},
series: [{
name: 'max',
data: [40],
color: 'white'
}, {
name: 'current',
data: [60],
color: 'green'
}]
});
});
});
最佳答案
关于css - HighCharts-删除条形图的填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14811145/