How could i display a Graph on WindowsForms?

M.Spitz picture M.Spitz · Aug 2, 2016 · Viewed 17.8k times · Source

i am a beginner at c#, so you could help me. At first, i get some data from a RS422 to USB converter over a COM Port and now i want to display over the right COM-Port the graph on the Screen. My Question: How could i display the Graph on my WindowsForms ?

Sorry for my english.

M.Spitz

Answer

Mong Zhu picture Mong Zhu · Aug 2, 2016

There is a nice tool un Windows Forms called Chart. You can draw graphs of different kind with it.

Here is a Tutorial

Here is a Video that shows how to use it.

Here is a nice post with an example from StackOverflow.

Have fun exploring it.

Basically the steps are:

  1. Create a Series for each line you want to draw.

  2. Add the values from your array or list to the series.

EDIT: 3. See comment by TaW

EDIT 2) : here you find all different chart types that can be displayed.

and here how to use them.

When you click in the property window of the chart on Series you get the Series-Properties. There you can also find the property: ChartType and set it by a mouse click if you want to.