I'm a new in jqplot. Today I attempted to refresh a created line jqplot chart as the guidance from http://jsfiddle.net/fracu/HrZcj/.
First, I create a jqplot chart with a array of data, following is the code fragment:
var colors = ['red', 'blue', 'green'];
var dataset = [[232,234,235,556,233],[234,563,234,866,345],[234,564,567,345,234]];
var lengeds = [{label: 'Test'}, {label: 'Upper'}, {label: 'Lower'}];
var analysisLabels = [[1, "Label1"], [2, "Label2"], [3, "Label3"], [4, "Label4"], [5, "Label5"]];
chart = $.jqplot("chart_id",
dataset,
{
title: 'Sample Chart',
legend: {
show: true,
placement: 'outsideGrid'
},
series: lengeds,
axes: {
xaxis: {
ticks: analysisLabels,
tickRenderer: $.jqplot.CanvasAxisTickRenderer,
tickOptions: {
angle: -30
}
},
yaxis: {
label: 'Fuel',
labelRenderer: $.jqplot.CanvasAxisLabelRenderer
}
},
seriesColors: colors,
highlighter: {
show: true
},
cursor: {
show: false
}
}
);
And then I intend to refresh it with a newly created dataset like this:
chart.series[0].data = chartSeriesTimes[0];
chart.series[1].data = chartSeriesTimes[1];
chart.series[2].data = chartSeriesTimes[2];
//chart.resetAxesScale();
chart.replot();
Chart displays nothing after the above code running, in other words, 3 formerly created curve lines are removed but newly added 3 curve dataset do not render.
I don't know why this happens since I do it follow official examples. Can anybody who good at jqplot gives me guidance. Thanks a lot.