Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/73.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
Jquery 使用关联数组填充图表_Jquery_Jqplot - Fatal编程技术网

Jquery 使用关联数组填充图表

Jquery 使用关联数组填充图表,jquery,jqplot,Jquery,Jqplot,我正在尝试使用包含以下数据的数组(dateVal)填充jqplot图表: console.log( index + " : " + dateVal[index]); OUTPUT BELOW February 01, 2013 : 12 February 02, 2013 : 12 February 03, 2013 : 12 February 04, 2013 : 43 February 05, 2013 : 45 我试图使用此代码,但它会引发一个未捕获的错误: var plot = $

我正在尝试使用包含以下数据的数组(dateVal)填充jqplot图表:

console.log( index + " : " + dateVal[index]);

OUTPUT BELOW

February 01, 2013 : 12
February 02, 2013 : 12
February 03, 2013 : 12
February 04, 2013 : 43
February 05, 2013 : 45
我试图使用此代码,但它会引发一个未捕获的错误:

var plot = $.jqplot('chart1', [dateVal], {

    title:'Rubric Average Scores',
    gridPadding:{right:35},
    axes:{xaxis:{renderer:$.jqplot.DateAxisRenderer,
        tickOptions:{formatString:'%Y-%m-%d'},
        //tickOptions:{formatString:'%b-%y'},
        tickInterval:'1 month',
        angle: -30,
    }},
    yaxis:{label:'Average Score',},
    series:[{lineWidth:3, markerOptions:{style:'square'}}]
});

我必须使dateVal成为数组的数组…

注意后面的逗号;他们可能会抛弃你