How do i draw graphs with C# + zedgraph

  • C#
  • Thread starter Ian_Brooks
  • Start date
  • Tags
    Graphs
In summary, the person is working on a thesis project involving drawing 2D graphs from input data collected wirelessly via bluetooth. They are using C# and are looking for a way to implement a 2D graphing program that can plot the data in real time and refresh to show the most recent plots. They are considering using the zedgraph library and are looking for tutorials/resources. Another person suggests using Active X components from Excel for drawing the graphs.
  • #1
Ian_Brooks
129
0
For my thesis project i'll soon want to draw 2D graphs based on input data coming wirelessly via bluetooth. The signals will be directional motion, acceleration, change in elevation and finally some added data on ECG, heart rate etc.

As I'm planning on having a C# GUI user interface - how would I implement a 2D graphing program?

What I need is a means of plotting the graph in real time and have it scroll across as the data comes in. It can then refresh and show the most recent plots of the data. Should I use zedgraph? Where can I find useful tutorials/resources/ etc?
Thanks in advance
 
Last edited:
Technology news on Phys.org
  • #2
Ian_Brooks said:
For my thesis project i'll soon want to draw 2D graphs based on input data coming wirelessly via bluetooth. The signals will be directional motion, acceleration, change in elevation and finally some added data on ECG, heart rate etc.

As I'm planning on having a C# GUI user interface - how would I implement a 2D graphing program?

What I need is a means of plotting the graph in real time and have it scroll across as the data comes in. It can then refresh and show the most recent plots of the data.


Should I use zedgraph? Where can I find useful tutorials/resources/ etc?



Thanks in advance

http://zedgraph.org/wiki/index.php?title=Sample_Graphs ?
 
  • #3
Ian_Brooks said:
For my thesis project i'll soon want to draw 2D graphs based on input data coming wirelessly via bluetooth. The signals will be directional motion, acceleration, change in elevation and finally some added data on ECG, heart rate etc.


As I'm planning on having a C# GUI user interface - how would I implement a 2D graphing program?

What I need is a means of plotting the graph in real time and have it scroll across as the data comes in. It can then refresh and show the most recent plots of the data.


Should I use zedgraph? Where can I find useful tutorials/resources/ etc?



Thanks in advance

Hi
I developed a quite similar project based on a datalogger recording an xyz accelerometer
data (12 bits, 240 samples/sec) plus 3 ECG channels (12 bits, 960 samples/sec) on an 2GB SD card and wrote a VB6 program using the NTGRAPH component for the graphs.
The result was quite OK.
Sonnen
 
  • #4
Ian_Brooks said:
For my thesis project i'll soon want to draw 2D graphs based on input data coming wirelessly via bluetooth. The signals will be directional motion, acceleration, change in elevation and finally some added data on ECG, heart rate etc.

As I'm planning on having a C# GUI user interface - how would I implement a 2D graphing program?

What I need is a means of plotting the graph in real time and have it scroll across as the data comes in. It can then refresh and show the most recent plots of the data.


Should I use zedgraph? Where can I find useful tutorials/resources/ etc?



Thanks in advance

Have you considered using the same active x components which are used to draw graphs in excel?
 
  • #5
John Creighto said:
Have you considered using the same active x components which are used to draw graphs in excel?

No, just used the NTGraph Active X Control.
 
  • #6
this is an easy ,if you have good ability in c#
codeproject have good sample of that and you can get your way through that
 

1. How do I install and set up ZedGraph in C#?

To install and set up ZedGraph in C#, you will need to first download and install the ZedGraph library from the official website. Once installed, you can add a reference to the ZedGraph.dll file in your C# project. You can then import the ZedGraph namespace in your code to use its classes and methods.

2. How do I create a basic graph using ZedGraph in C#?

To create a basic graph using ZedGraph in C#, you will need to first instantiate a ZedGraph control in your form. Then, you can add a GraphPane object to the control and add data points to it using the AddPoint method. Finally, you can customize the appearance of your graph by setting properties such as title, axis labels, and legend.

3. How do I add multiple curves to a graph using ZedGraph in C#?

To add multiple curves to a graph using ZedGraph in C#, you can use the AddCurve method of the GraphPane object. This method allows you to specify the data points, curve type, and other properties for each curve. You can also use the Legend property to add a legend for your graph and label each curve.

4. How do I save a graph as an image using ZedGraph in C#?

To save a graph as an image using ZedGraph in C#, you can use the GetImage method of the GraphPane object. This method returns a Bitmap object which you can then save to a file using the Save method. You can also specify the image format and resolution in the GetImage method parameters.

5. How do I add custom labels or annotations to a graph using ZedGraph in C#?

To add custom labels or annotations to a graph using ZedGraph in C#, you can use the TextObj class. This class allows you to specify the position, text, and font of your label or annotation. You can then add the TextObj object to the GraphPane object using the AddText method. This is useful for adding additional information or explanations to your graph.

Similar threads

  • Programming and Computer Science
Replies
5
Views
1K
  • Other Physics Topics
Replies
23
Views
13K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Introductory Physics Homework Help
Replies
6
Views
4K
  • Introductory Physics Homework Help
Replies
20
Views
2K
  • Programming and Computer Science
Replies
3
Views
3K
  • Programming and Computer Science
Replies
6
Views
3K
  • Introductory Physics Homework Help
Replies
4
Views
1K
  • Precalculus Mathematics Homework Help
Replies
5
Views
2K
Replies
1
Views
3K
Back
Top