Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm totally new to C#, in fact any coding language. I've written a code which takes values (Temp and Weight) from Serial Port (COM Port) and store those values in DataGridView1. Now, as values written to the DataGridView1, I want them to plot on graph using LiveChart Nuget Package.

If line graph can be done on separate form then it's really good for me. If not, at least suggest me to plot a line graph on same form. Please refer below image for the output:

Note: X Axis value (Weight) start from 100 and ends at 0.

What I have tried:

I've written a code which takes values (Temp and Weight) from Serial Port (COM Port) and store those values in DataGridView1. Now, as values written to the DataGridView1, I want them to plot on graph using LiveChart Nuget Package.
Posted
Updated 30-Sep-20 6:45am
v2

1 solution

You have 3 "components":

1) One to collect the data into a queue / collection. (e.g. BackgroundWorker)

2) Another that updates the Grid

3) Another that updates the chart.

If #1 uses an observable collection, #2 and #3 can subscribe to the update events (implicitly via an ItemSource, or explicitly via event handlers), and update their UI in turn.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900