Performance issue with Teechart.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Vivek
Newbie
Newbie
Posts: 9
Joined: Tue Mar 10, 2009 12:00 am
Contact:

Performance issue with Teechart.

Post by Vivek » Mon Jul 06, 2009 7:00 am

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
Attachments
pocTchart.zip
(13.4 KiB) Downloaded 473 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Performance issue with Teechart.

Post by Sandra » Mon Jul 06, 2009 10:21 am

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,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Pradip
Newbie
Newbie
Posts: 14
Joined: Tue Mar 10, 2009 12:00 am
Contact:

Re: Performance issue with Teechart.

Post by Pradip » Fri Jul 10, 2009 5:36 pm

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.

Vivek
Newbie
Newbie
Posts: 9
Joined: Tue Mar 10, 2009 12:00 am
Contact:

Re: Performance issue with Teechart.

Post by Vivek » Mon Jul 13, 2009 5:42 am

Hi Please find the attached sample code for Pradip's post. We have tried to replicate the problem.
Attachments
Navigation Issue.zip
(234.18 KiB) Downloaded 475 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Performance issue with Teechart.

Post by Sandra » Mon Jul 13, 2009 7:33 am

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
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply