‎2022-02-21 11:59 PM
Hi,i want to make a oscilloscope to show two data curve.I found the dynamicgraph can add many lines with different color.BUT i can only use the "addDataPoint" fuction to add one data at one time.So I set the two lines the different LineWidth.
Just like this.
These two lines show the same data,becuse the addDataPoint function can just input one variate.I want to know how can i draw multiple lines that show the different data in one dynamic graph?
‎2022-02-22 12:32 AM
Every line on the graph will be presented as dynamicGraphX (or whatever you have named it) class.
Then you should add all data at the same time:
dynamicGraph1.addDataPoint( value1 );
dynamicGraph2.addDataPoint( value2 );
dynamicGraph3.addDataPoint( value3 );
‎2022-02-22 12:44 AM
I just create one dynamicgraph widget,it will be error.
I want to show these two lines which in the right just in dynamicgraph1.:persevering_face:
‎2022-02-22 01:52 AM
Check your Screen1ViewBase.hpp header for correct names. They should be of type touchgfx::GraphScroll<NNN> like:
touchgfx::GraphScroll<100> dynamicGraph1;
touchgfx::GraphScroll<100> graph2;
touchgfx::GraphScroll<100> graph3;
Then use those classes.
‎2022-02-22 03:29 AM
Hello EWqqr.1,
I wouldn't recommend you to use 2 lines elements for a single dynamic graph widget. The easiest way would be to use 2 different widgets like this :
Be careful to uncheck the boxes on "Vertical Grid Lines", "Horizontal Grid Lines", "X-Axis Labels" and "Y-Axis Labels". That way, you will have 2 independent graph lines in the same view.
I attached a basic project if you need an example.
/Osman
‎2022-02-22 03:48 AM
Thank you all.I create two dynamic graph and align them.The program ran successfully now.
‎2022-02-22 04:34 AM
It would be nice if you could explain why you do not recommend to use multiple lines with single dynamicGraph object.​
‎2022-02-22 06:02 AM
It's not the easiest way to do. Indeed the lines are instances of GraphElementLines class, and you can't use addDataPoint() function with them.
‎2024-03-16 01:03 PM
So its still not possible to add multiple lines into single data graph. Instead of that, you have to create N data graphs and allocate way more RAM?