我正在尝试删除此图表顶部和底部的空间http://jsfiddle.net/bfa1o0ar/7/。它是第一个小节之前和最后一个小节之后的间距。我试过删除填充,边距等。
$(function() {
Highcharts.chart('container', {
chart: {
marginTop: 0,
marginBottom: 0,
spacingTop: 0,
spacingBottom: 0,
type: 'bar',
title: {
text: ''
}
},
credits: {
enabled: false
},
title: {
text: null
},
xAxis: {
minPadding:0,
maxPadding:0,
lineWidth: 0,
gridLineWidth: 0,
tickWidth: 0,
tickAmount: 0,
tickmarkPlacement: 'on',
categories: ['1-3', '4-7', '7-10', '11-14', '15-20'],
allowDecimals: false,
},
yAxis: {
minPadding:0,
maxPadding:0,
lineWidth: 0,
gridLineWidth: 0,
endOnTick: false,
showFirstLabel: false,
showLastLabel: false,
startOnTick: false,
tickWidth: 0,
tickAmount: 0,
//tickmarkPlacement: 'between',
min: 0,
allowDecimals: false,
title: {
text: ''
},
stackLabels: {
enabled: true,
style: {
fontWeight: 'bold',
color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
}
}
},
legend: {
enabled: false
},
plotOptions: {
column: {
groupPadding: 0,
pointPadding: 0,
//pointWidth: 35, // width of bar
pointRange: 0
},
series: {
pointPadding: 0.1,
groupPadding: 0,
borderWidth: 0,
//pointWidth: 30,
shadow: false,
stacking: 'normal',
dataLabels: {
align: 'right',
enabled: false,
color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
},
}
},
series: [{
name: 'John',
data: [5, 3, 4, 7, 2]
}]
});
});
将x轴的最小值/最大值设置为first category index + 0.1
和last category index - 0.1
min: 0 + 0.1,
max: 4 - 0.1
},
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句