Skip to main content
Junde
Senior III
October 23, 2024
Solved

How to change the static graph line's color?

  • October 23, 2024
  • 1 reply
  • 2178 views

Hi there,

As the title, I use a static graph with a line, and I want to change the line's color according the data.

But I check the API of static graph in TouchGFX document, I didn't find the function like setColor() or setLineColor().

How can I do it by code?

Thanks

Best answer by Junde

I got it.

// the static graph object is named graph1
graph1Line1Painter.setColor(0x00FF00);

1 reply

Junde
JundeAuthorBest answer
Senior III
October 23, 2024

I got it.

// the static graph object is named graph1
graph1Line1Painter.setColor(0x00FF00);