我有一个 jQplot 图表,我需要将月份
标签(一月、二月、三月、四月、五月、六月、七月...)放置到我的 X 轴上。
我尝试了教程中的一些示例,但它们不起作用。
有人可以帮助我吗?
<小时/>这是我到目前为止所拥有的:
jQuery(document).ready(function(){
jQuery.plot(jQuery("#chartplace2"), [{
data : [[6, '0'], [5, '0'], [4, '0'], [3, '0'], [2, '0'], [1, '0'], [0, '32000']],
label : "Mijolino",
color : "#79755c"
}, {
data : [[6, '0'], [5, '0'], [4, '0'], [3, '0'], [2, '0'], [1, '0'], [0, '42500']],
label : "Mija",
color : "#78d6d0"
}], {
series : {
lines : {
show: true,
fill : true,
fillColor : {
colors : [{
opacity : 0.1
}, {
opacity : 0.20
}]
}
},
points: {
show : true
}
},
legend: {
position : 'nw'
},
grid: {
hoverable : true,
clickable : true,
borderColor : '#ccc',
borderWidth : 1,
labelMargin : 10
},
yaxis : {
min : 0,
max : 100000
},
title : {
text : 'Grafikon',
show : true
}
});
});
最佳答案
尝试这样的事情:
http://jsfiddle.net/pabloker/GsDMW/3/
var Mijolino = [['01/01/2013', '0'], ['02/01/2013', '0'], ['03/01/2013', '0'], ['04/01/2013', '0'], ['05/01/2013', '0'], ['06/01/2013', '0'], ['07/01/2013', '32000']];
var Mija = [['01/01/2013', '0'], ['02/01/2013', '0'], ['03/01/2013', '0'], ['04/01/2013', '0'], ['05/01/2013', '0'], ['06/01/2013', '0'], ['07/01/2013', '42500']];;
var plot1 = $.jqplot("chartplace2",
[Mijolino,Mija], {
seriesDefaults: {
lines: {
show: true,
fill: true
},
points: {
show: true
}
},
legend: {
position: 'nw'
},
grid: {
hoverable: true,
clickable: true,
borderColor: '#ccc',
borderWidth: 1,
labelMargin: 10
},
axes:{
xaxis: {
renderer:$.jqplot.DateAxisRenderer,
tickOptions:{formatString:'%Y-%b'},
min: '01/01/2013'
},
yaxis: {
min:0,
max:50000
}
},
title: {
text: 'Grafikon',
show: true}
});
关于javascript - jQplot统计量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14682180/