Page 1 of 1
Performance issue with Teechart.
Posted: Mon Jul 06, 2009 7:00 am
by 13052775
Hi
We are facing performance issue with Teechart. Follwoing are the details for this issue
1. We have around 300 series in a chart.
2. Each series have around 1000 points. This is required, we cant reduce the points for each series.
3. We are facing performanc hit while manipulating details of a series which requires paiting.
Please see the sample applicaiton attached herewith. Click on the OK button, and naviagte in the list. you will observer perfomance hit. Out client says that this performance hit was not there in ther earlier applicaiton which had other chart like NI chart.
Please look into this issue on very high priority issue as this issue has become a show stopper for market release of our product
With Rergards
Vivek
EXFO India
Re: Performance issue with Teechart.
Posted: Mon Jul 06, 2009 10:21 am
by 10050769
Hello vivek,
I could reproduce your problem and I recomend that see article
real-time charting, that give some ideas for improve performance. On the other hand, I modified your code, because went faster then previous code. I assigned values direcly X and Y using arrays and without sort, also if you want to works faster you can order data previously and then assign values to chart series.
See nex code and check that works faster. In code there are a counter to calculate time it takes.
Code: Select all
private void Form1_Load(object sender, EventArgs e)
{
graph.Chart.Aspect.View3D = false;
graph.Axes.Bottom.Maximum = 100;
stopWatch = new System.Diagnostics.Stopwatch();
graph.AfterDraw += new Steema.TeeChart.PaintChartEventHandler(graph_AfterDraw);
}
private System.Diagnostics.Stopwatch stopWatch;
private void button1_Click(object sender, EventArgs e)
{
Random r;
FastLine f;
double[] x1;
double[] y1;
listBox1.Items.Clear();
graph.Series.Clear();
stopWatch.Reset();
stopWatch.Start();//Calculate Time;
graph.AutoRepaint = false;
for (int k = 0; k < 300; k++)
{
f = new FastLine();
f.Color = Color.Silver;
r = new Random();
x1 = new double[1000];
y1 = new double[1000];
f.XValues.Order = ValueListOrder.Ascending;
for (int i = 0; i < x1.Length; i++)
{
x1[i] = i * r.NextDouble();
y1[i] = i;
}
f.XValues.Value = x1;
f.YValues.Value = y1;
f.XValues.Count = x1.Length;
f.YValues.Count = y1.Length;
listBox1.Items.Add(k);
graph.Series.Add(f);
}
graph.AutoRepaint = true;
Application.DoEvents();
stopWatch.Stop();//Stop calculate time.
}
void graph_AfterDraw(object sender, Steema.TeeChart.Drawing.Graphics3D g)
{
//calculate elapsed time
TimeSpan elapsedTime = stopWatch.Elapsed;
string total = elapsedTime.TotalSeconds.ToString();
this.Text = "Elapsed time: " + total + " s";
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
this.graph.Chart.Series[listBox1.SelectedIndex].Color = Color.Red;
}
I hope will helps.
Thanks,
Re: Performance issue with Teechart.
Posted: Fri Jul 10, 2009 5:36 pm
by 13052776
hi sandra,
thanks for the reply,
we tried your solution but the performance is not improved as we expected.
the performance for National instrument component is much better than Tee chart in the same scenario.
please suggest us any other solution so that we can match with the performance of national Instrument component.
Thanks in Advance.
Re: Performance issue with Teechart.
Posted: Mon Jul 13, 2009 5:42 am
by 13052775
Hi Please find the attached sample code for Pradip's post. We have tried to replicate the problem.
Re: Performance issue with Teechart.
Posted: Mon Jul 13, 2009 7:33 am
by 10050769
Hello vivek,
I couldn't execute your project .exe, don't works. Please you can send a project, because we can reproduce here.You can attach your project directly in the post.
Thanks