下面是我的代码:
var months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
Morris.Area({
element: 'chart_area',
data: [{
m: '2016-7',
value: 19
}, {
m: '2016-6',
value: 2
}, {
m: '2016-5',
value: 3
}],
xkey: 'm',
ykeys: ['value'],
labels: ['Total Hit'],
yLabelFormat: function(y) {
return y != Math.round(y) ? '' : y;
},
xLabelFormat: function(x) {
var month = months[x.getMonth()];
return month;
},
dateFormat: function(x) {
var month = months[new Date(x).getMonth()];
return month;
}
});这是我创建的fiddle。7月的xLabel在最后消失了。
任何帮助都将不胜感激。谢谢!
发布于 2016-07-26 06:15:02
https://stackoverflow.com/questions/38546187
复制相似问题