locked
line charts every second RRS feed

  • Question

  • Hello.

    I need to visualize in real time some data. I use Chart Control to draw a FastLine Chart, and with AJAX I redraw the chart with another new point, but I need to create betwin 3-7 Charts per second with new data, and the process is very slow. I dont understand a lot how the chat control draws a chart.

    I think if I draw at the same time 10 charts, and every second with AJAX I load each chart the "refresh effect" will disapear.

    There is another method to draw every second few charts with refesh, or flush effect?

     

    Thanks!

     

    PD Sorry for my english

    Thursday, March 25, 2010 12:14 PM

Answers

  • Couple things you are doing wrong. The chart implicitly supports real time rendering. You do not need to use a timer. A timer will slow things down for each fired event. Here is what you need:

     

     

    protected void Timer1_Tick(object sender, EventArgs e)

    {

    //get your data

    int xValue = 0; yValue = 2;

    //add points

    Chart1.Series.Points.AddXY(xValue, YValue);

    }

    Place both the timer and the chart inside an update panel. That will fix your refresh issue; it won't solve your performance issue though.

    Sunday, April 4, 2010 10:44 PM

All replies

  • Drawing that number of charts every second is resource intensive. There really is no way to increase the speed because a lot of it is spent 'outside' your application such as the render process etc.

    Perhaps what you are after are drawing or updating different series on a ONE chart. That way, changes to the data are reflected in real time. Is that your requirement? I've posted some code in this forum on how to do this.

    Thursday, March 25, 2010 6:16 PM
  • If I have some series on the same chart (each serie with one more point), and with the timer event I enable only one serie at the same time I could obtain real time effect, but is possible? How I could do this?

    Another idea is generate all the charts (for example 10 charts with one more data), and per second I could load from de disk one image. Maybe on this way is possible to "draw" every second differents charts.

    For my project I use the Real Time example, and for one chart there is no any "refresh" effect, but with 3 or more charts is impossible.

     

    Thanks

    Thursday, March 25, 2010 9:56 PM
  • How can I "draw" 10 charts at the same time but saving the images to the disk so after that I could load one image every second and on this way maybe the real time effect with 3-7 charts maybe possible?
    Friday, March 26, 2010 9:22 AM
  • I have tried to create one only chart with 7 series. When I use my own pc as a server, the real time effect is very nice but if I view the page from another pc, when the image refreshes I see chart - blank - chart - blank...


    How can I resolve this?

     

    Thanks

    Sunday, March 28, 2010 5:54 PM
  • Couple things you are doing wrong. The chart implicitly supports real time rendering. You do not need to use a timer. A timer will slow things down for each fired event. Here is what you need:

     

     

    protected void Timer1_Tick(object sender, EventArgs e)

    {

    //get your data

    int xValue = 0; yValue = 2;

    //add points

    Chart1.Series.Points.AddXY(xValue, YValue);

    }

    Place both the timer and the chart inside an update panel. That will fix your refresh issue; it won't solve your performance issue though.

    Sunday, April 4, 2010 10:44 PM