Hi!
I'm trying to do a dynamic graph with dots, where the most recent dot need to have a different color from the previous.
I'm using a for loop and setting the colors according to the last position of the data in a buffer,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-01-10 4:43 AM
but the dots are printed with the same color.
Is it possible setting different colors for dots in a dynamic graph?
Thank you.
- Labels:
-
TouchGFX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-01-11 1:04 AM
There are several ways to do this.
The easiest and most performant would be to
override the GraphElementDots class and change the color of the last dot.
This would also be very performant.
Disadvantage: You have to change the autogenerated base classes to include the new GraphElementDots class.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-01-12 3:13 AM
Thanks JBenn,
Is there a way where I don't need to override the GraphElementDots class?
I don't feel comfortable in changing the autogenerated base classes, so I prefer implementing the code in more external layers.
Thank you again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-01-13 6:50 AM
Not really something I should recommend as it isn't optimized at all :grinning_face_with_sweat: but I did once a similar project where I just put two graphs on top of each other where one would be one step behind with points in a different color so that it looked like the latest point was in a different color.
/Romain
