我有一张我昨天和今天早上在 jsFiddle 上工作的图表:
如果您看一下,您会发现列的 xAxis 标签并不总是显示出来。我确信某处有一个设置迫使他们始终显示或可能设置间隔的方法,但到目前为止我在 API 文档中找不到它。如果有人能指出我正确的方向,我会很高兴。
谢谢一堆。
Highcharts代码如下:
var go_local_scriblio_authority_history = new Highcharts.Chart({
chart: {
renderTo: 'go-local-scriblio-authority-history',
type: 'column'
},
credits: {
enabled:false
},
title: {
text: null
},
subtitle: {
text: null
},
xAxis: {
type: 'datetime',
labels: {
step: 1,
rotation: -90,
style: {
fontSize: '10px',
fontFamily: 'Helvetica, sans-serif',
color: '#629bc0'
},
x: 3,
formatter: function() {
return Highcharts.dateFormat('%b', this.value).toUpperCase();
}
},
reversed: false,
lineColor: '#ffffff',
tickColor: '#ffffff'
},
yAxis: {
min: 0,
labels: false,
title: false,
gridLineColor: '#ffffff',
},
legend: false,
tooltip: {
formatter: function() {
return '<strong>' + Highcharts.dateFormat('%b %Y', this.x) + ':</strong> ' + this.y;
}
},
series: [{
name: 'Article Counts by Month',
color: '#629bc0',
data: [[Date.UTC(2013, 2, 1),2], [Date.UTC(2013, 1, 1),22], [Date.UTC(2012, 12, 1),11], [Date.UTC(2012, 11, 1),22], [Date.UTC(2012, 10, 1),28], [Date.UTC(2012, 9, 1),37], [Date.UTC(2012, 8, 1),38], [Date.UTC(2012, 7, 1),60], [Date.UTC(2012, 6, 1),87], [Date.UTC(2012, 5, 1),53], [Date.UTC(2012, 4, 1),62], [Date.UTC(2012, 3, 1),51], [Date.UTC(2012, 2, 1),29], [Date.UTC(2012, 1, 1),54], [Date.UTC(2011, 12, 1),50], [Date.UTC(2011, 11, 1),49], [Date.UTC(2011, 10, 1),45], [Date.UTC(2011, 9, 1),40], [Date.UTC(2011, 8, 1),42], [Date.UTC(2011, 7, 1),50], [Date.UTC(2011, 6, 1),48], [Date.UTC(2011, 5, 1),57], [Date.UTC(2011, 4, 1),44], [Date.UTC(2011, 3, 1),52]]
}],
plotOptions: {
series: {
borderWidth: 0,
shadow: false,
pointWidth: 10,
pointPadding: 0,
groupPadding: 0,
}
}
});