cancel
Showing results for 
Search instead for 
Did you mean: 

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,

FDigi
Associate III

but the dots are printed with the same color.

Is it possible setting different colors for dots in a dynamic graph?

Thank you.

3 REPLIES 3
JBenn.1
Associate II

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.

FDigi
Associate III

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.

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