categories: [
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
'Sunday',
'ooo1',
'ooow',
'ooo23'
]
这个标签不显示原因?
'ooo1',
'ooow',
'ooo23'
码
http://jsfiddle.net/ogwsL7j3/5/
$(function () {
$('#container').highcharts({
chart: {
type: 'areaspline'
},
title: {
text: 'Average fruit consumption during one week'
},
legend: {
layout: 'vertical',
align: 'left',
verticalAlign: 'top',
x: 250,
y: 300,
floating: true,
borderWidth: 1,
backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
},
xAxis: {
categories: [
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
'Sunday',
'ooo1',
'ooow',
'ooo23'
]
},
yAxis: {
title: {
text: ''
},
labels: {
enabled:false
}
},
tooltip: {
shared: true,
valueSuffix: ' units'
},
credits: {
enabled: false
},
plotOptions: {
areaspline: {
fillOpacity: 0.8
}
},
series: [{
name: 'John',
data: [3, 4, 3, 5, 4, 10, 12]
}]
});
});
答案 0 :(得分:1)
你没有看到ooo1,ooow和ooo23的原因是因为没有数据,你需要为它们分配一些东西,至少是0: 改变这个:
series: [{
name: 'John',
data: [3, 4, 3, 5, 4, 10, 12]
}]
对此:
series: [{
name: 'John',
data: [3, 4, 3, 5, 4, 10, 12,0,0,0]
}]
在这里看到你更新的小提琴: http://jsfiddle.net/ogwsL7j3/7/
答案 1 :(得分:0)
由于您有类别,因此您没有那么多数据点。只需增加数据点数
...
data: [3, 4, 3, 5, 4, 10, 12, 13, 14, 15]
...