Best tool for plot real time graph in C#

Thread Starter

embpic

Joined May 29, 2013
189
which is best tool for ploting graph using C#. i tried using zedgraph tool with the help of timer tick but it is not updating
graph as per value.
it updates only when i scroll up or down then only it get updates.
actually i want to plot graph of real time means it get updates as the value get updates.
 

Thread Starter

embpic

Joined May 29, 2013
189
i don't want to make chart i want to plot data coming from serial interface like real time plot. is it possible with this.
 

sirch2

Joined Jan 21, 2013
1,071
Like tshuck says, why not draw the graph yourself? It's just a few lines and some scaling, you get a lighter weight component and much more control over it. Google "c# draw line".
 

tshuck

Joined Oct 18, 2012
3,534
i don't want to make chart i want to plot data coming from serial interface like real time plot. is it possible with this.
Yes, you can do that using the chart control - you'd have to modify the collection of points in a series on the chart each time you get data (not hard).

On the serial interface, register for the data received event and use that data to add the X and Y points for the series, then, you may need to invalidate the chart control.

As an example, maybe something like:
Rich (BB code):
 public serialPort1_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
    int data = serialPort1.ReadByte();
    // data received
    chart1.Series["serial data"].Points.AddXY
                        (DateTime.UtcNow, data);

    //chart1.Invalidate();
}
You'll probably have to create the "serial data" series in the chart before this event gets called...



...or, you could draw it yourself, which, if you don't understand the above, would probably be faster...
 
Last edited:
Top