I use teechart for bar charts as well as for line charts. During the runtime, I close teechart and recall it. The problem is that the chart shows both previous lines/Series and the current new lines/Series. I only want current new lines are shown as I call the teechart. I don't know how to "get default" or "delete/clear previous lines" when I recall teechart.
I have tried different ways (code).
Thanks, Juliane
Code: Select all
//This works with recall:
function barChart(chart_bar)
{
var vdata = new Tee.Bar();
chart_bar.removeSeries( vdata );
chart_bar.addSeries( vdata );
//...
}
//This works not with recall:
var lineData //global variable;
var key_array = [];
var bol_vals_strings = [];
function lineChart(chart_ser, bol)
{
if (lineData)
{
chart_ser.removeSeries(lineData);
}
for (key in bol)
{
key_array.push(key);
bol_vals_strings = bol[key];
var val_array = [];
for (var k = 0; k < bol_vals_strings.length; k++)
{
val_array.push(bol[key][k]);
}
var vdata = new Tee.Line();
var vals = val_array;
vdata.data.values = vals;
chart_ser.addSeries( vdata );
lineData = vdata;
//....
}
}