2019-08-09 06:15 AM
I need to display a filled graph, where some portions of the graph needs to be displayed in different colour than the basic colour of the graph.
The graph is displayed using a canvas widget, created in touchgfx 4.10.0.
In the drawCanvasWidget function, the graph is drawn using lineTo commands. (The filled effect is created by drawing a series of vertical lines adjacent to each other). The problem is that colour of the line can not be changed in the drawCanvasWidget function as the function is const.
So, how can the part of graph be drawn in multiple colours?
A sample of the graph is in the file attached.
Regards
Mathews
Solved! Go to Solution.
2019-08-13 04:45 AM
Hi,
You may be able to get some inspiration from the demo "TouchGFX Demo 1", application from the designer. It has some advanced graph usage where it can fill part of the graph below the line "GraphBelow.cpp". Check it out and see if it, or a part of it, fits.
/Martin
2019-08-13 04:45 AM
Hi,
You may be able to get some inspiration from the demo "TouchGFX Demo 1", application from the designer. It has some advanced graph usage where it can fill part of the graph below the line "GraphBelow.cpp". Check it out and see if it, or a part of it, fits.
/Martin
2019-08-15 06:08 AM
Hi Martin,
Thanks for the inputs. I am going through the TouchGFX_Demo_Graph example, and it looks like, I can solve the problem by taking input from the demo.
Regards
Mathews
2019-08-15 06:15 AM
That's great, Mathews!
2019-08-21 06:59 AM
Hi Martin,
I was able to implement the multi-coloured graph, by creating two graph objects, each taking care of one colour each. The idea is basically derived from the Demo_Graph example. Thanks a lot for your reference application.
Regards
Mathews
2019-08-21 11:30 PM
That's great to hear, Mathews. Good job!
Best regards,
Martin