cancel
Showing results for 
Search instead for 
Did you mean: 

Touchgfx graph elements how to add points to graphs with multiple elements

Garnett.Robert
Senior III

Hi

I wish to display two variables on a line graph.

I create the graph in the TouchGFX deigner with Line1 and Line 2.

However I cannot work out how to set add points to the graph.

I used the method:

/**************************************************************/
void Screen1View::handleTickEvent()
{
    tickCounter++;
 
    // Insert each second tick
    if (tickCounter % 3 == 0)
    {
        float yMax = graph1.getGraphRangeYMaxAsFloat();
 
        // Insert "random" points along a sine wave
        graph1.addDataPoint((int)(Detector_Y.NormOp * 50 + 50));
    }
}

In my Screen1View.cpp file, but it adds the same point to both lines.

There doesn't seem to be a method that adds points to the graph elements.

How do I do this?

Do I need two seperate graph widgets overlayed?

Best regards

Rob

10 REPLIES 10

Just as I thought.

 

I hope they fix this soon.