Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
Example code / speed
posted

Hi,

First:

Is there any example code for the xamChart ? I try to use scatter XY lines...

Second:

I have to draw 1000 to 1500 points with real-time acquisition, 1 points every 50ms...
I made a spline line with 1500 points: it takes 5s to redraw the chart on windows resizing !

  • Note 1: Last month, I evaluated the Infragistics chart (from NetAdvantage for Windows Form2007 Vol 3) which was too slow (according to my needs). The competitors (Dundas Chart, ChartFX and Nevron Chart), were 5 to 10 times faster...
  • Note 2: I bought NetAdvantage for Windows Form. I use and appreciate the following components: Ribbon, DockManager, Grid,  Excel Exporter, Print. I will like to update to wpf version, but I must wait until these components are available (especially Ribbon and Dock Manager).
  • Note 3: my PC = Dell Optiplex GX745, Pentium D CPU 3GHz, 1Go RAM

What can I do ?
Sincerely

Loïc

 Please excuse my poor english, I'm french...

Parents
  • 739
    posted

     

    Hi Loïc

    To improve performence RefreshEnabled property has to be used.  This is a sample which creates scatter chart:

     

    public Scatter_Line_Chart_2D()

    {

       // Disable the chart refreshing to improve performance

       this.ScatterLineChart2D.RefreshEnabled = false;  

       for (int pointIndx = 0; pointIndx < 100; pointIndx++)

       {

          DataPoint point = new DataPoint();

          double mean = 50;

          double sigma = 10;

          double x = (double)pointIndx;

          double y = Math.Exp(-Math.Pow(x - mean, 2) / (2 * Math.Pow(sigma, 2))) / (sigma * Math.Sqrt(2 * Math.PI));

          point.ChartParameters.Add(ChartParameterType.ValueX, x);point.ChartParameters.Add(ChartParameterType.ValueY, y);

          point.ToolTip = y;

          this.ScatterLineChart2D.Series[0].DataPoints.Add(point);

       }

       // Enable the chart refreshing

       this.ScatterLineChart2D.RefreshEnabled = true;

    }

    Sincerely,

    GoranS

Reply Children