Jquery 使用关联数组填充图表
我正在尝试使用包含以下数据的数组(dateVal)填充jqplot图表: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 = $
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成为数组的数组…注意后面的逗号;他们可能会抛弃你