大神们 JS中的highcharts怎样 能让xAxis 的categories 中的时间编程动态的啊
$(function(){$('#container_pic').highcharts({title:{text:'MonthlyAveragePrice',x:-20/...
$(function () {
$('#container_pic').highcharts({
title: {
text: 'Monthly Average Price',
x: -20 //center
},
xAxis: {
categories: ['15-04', '15-05', '15-06', '15-07', '15-08', '15-09',
'15-10', '15-11', '15-12', '16-01', '16-02', '16-03']
},
yAxis: {
title: {
text: 'Price(元)'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: '元'
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},
series: [{
name: 'Price',
data: [{$resGPT[0]['price']},
{$resGPT[1]['price']},
{$resGPT[2]['price']},
{$resGPT[3]['price']},
{$resGPT[4]['price']},
{$resGPT[5]['price']},
{$resGPT[6]['price']},
{$resGPT[7]['price']},
{$resGPT[8]['price']},
{$resGPT[9]['price']},
{$resGPT[10]['price']},
{$resGPT[11]['price']}]
}]
});
}); 展开
$('#container_pic').highcharts({
title: {
text: 'Monthly Average Price',
x: -20 //center
},
xAxis: {
categories: ['15-04', '15-05', '15-06', '15-07', '15-08', '15-09',
'15-10', '15-11', '15-12', '16-01', '16-02', '16-03']
},
yAxis: {
title: {
text: 'Price(元)'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: '元'
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0
},
series: [{
name: 'Price',
data: [{$resGPT[0]['price']},
{$resGPT[1]['price']},
{$resGPT[2]['price']},
{$resGPT[3]['price']},
{$resGPT[4]['price']},
{$resGPT[5]['price']},
{$resGPT[6]['price']},
{$resGPT[7]['price']},
{$resGPT[8]['price']},
{$resGPT[9]['price']},
{$resGPT[10]['price']},
{$resGPT[11]['price']}]
}]
});
}); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询