Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/236.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何使用datetime作为yaxis和xaxis的category绘制jqplot_Php_Jqplot - Fatal编程技术网

Php 如何使用datetime作为yaxis和xaxis的category绘制jqplot

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

巴鲁凡=['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], {
        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
}