Php 如何使用datetime作为yaxis和xaxis的category绘制jqplot
巴鲁凡=['8:30','10:30'];行不通。导致其时间格式。Php 如何使用datetime作为yaxis和xaxis的category绘制jqplot,php,jqplot,Php,Jqplot,巴鲁凡=['8:30','10:30'];行不通。导致其时间格式。 如果使用类似bar_fan的值=[1,2];会有用的。 我如何使用带有日期时间值的yaxis?我只需将以下内容添加到轴配置中,就可以让他工作: var bar_fan = ['8:30','10:30']; var bar_ticks = ['a','b']; $(document).ready(function(){ plot2 = $.jqplot('bar_all', [bar_fan], { s
如果使用类似bar_fan的值=[1,2];会有用的。
我如何使用带有日期时间值的yaxis?我只需将以下内容添加到
轴配置中,就可以让他工作:
var bar_fan = ['8:30','10:30'];
var bar_ticks = ['a','b'];
$(document).ready(function(){
plot2 = $.jqplot('bar_all', [bar_fan], {
seriesDefaults: {
renderer:$.jqplot.BarRenderer,
pointLabels: { show: true },
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: bar_ticks,
},
},
legend: {
show: true,
labels: bar_labels,
placement: 'outside'
}
});
现在,因为您的只是时间值,所以图表将假定当前日期。然后,您可能需要指定最短日期或明确提供日期和时间信息,例如,'2013-03-01 8:30AM'
yaxis: {
renderer: $.jqplot.DateAxisRenderer
}