之前我使用过Hightcharts。这是我的代码:
function drawLine(data, title, selector, name) {
$(selector).highcharts({
title: {
text: title,
x: -20 //center
},
xAxis: {
categories: data.map(function(i) { return new Date(parseInt(i.Index.substr(6))).toDateString(); })
},
yAxis: {
title: {
text: 'Count '
},
plotLines: [
{
value: 0,
width: 1,
color: '#808080'
}
]
},
tooltip: {
valueSuffix: ''
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},
series: [
{
name: name,
data: data.map(function(i) { return i.Value; })
}
]
});
}
我如何使用Highstock做同样的事情? 问题在于:
xAxis: {
categories: data.map(function(i) { return new Date(parseInt(i.Index.substr(6))).toDateString(); })
}
Highstock不包含“类别”。