Issue #434 resolved

data[i] is undefined in 4097 line of jquery.jqplot.js‏

Anonymous created an issue

When use the the following A.js and run B.js to add series data, in the final step "chart.drawSeries({},0)" the firefox's error control displayed: data[i] is undefined (in 4097 line of jquery.jqplot.js). The 4097 should be "if (data[i][0] != null && data[i][1] != null) {"

[A.js]--------------------------------------------------

var data=[[["2012-12-12",50]]];

var chart=$.jqplot("chart",data,{ axes:{ xaxis:{ renderer:$.jqplot.DateAxisRenderer, max:"2011-10-31", min:"2011-10-01", tickOptions:{ showMark:false, showGridline:false, formatString:"%#m/%#d" }, tickInterval:"5 days" }, yaxis:{ max:100, min:30, numberTicks:8, tickOptions:{ showMark:false, formatString:"%d" } } }, grid:{ shadow:false, borderWidth:0, gridLineColor:"#dddddd", background:"#ffffff" }, seriesDefaults:{ shadowDepth:2, lineWidth:2, markerOptions:{ size:5, color:"#00000", shadowDepth:2 } }, highlighter: { show:true, sizeAdjust:7 } });


[B.js]--------------------------------------------------

$("#record_date").datepicker(); $("#ok").click(function() {

var record_date=new Date($("#record_date").val());

chart.series[0].data.push([record_date,$("#something").val()]);

chart.drawSeries({},0);

});


Comments (3)

  1. Anonymous

    I think the bug comes from using this.data in the loop line above, and later use data[i] with data being this._plotData instead of this.data. The 2 arrays may not have the same length. Changing this.data into this._plotData in the for loop fixes it.

  2. Anonymous

    I see now that it has been fixed in revision 1016 of jqplot.lineRenderer.js (date: 2011-11-20).

  3. Log in to comment