10-15-2015 06:27 AM
Hello, I have a XY graph with 4 plots with diferet colors each. When modifiying the plot color of each plot, the plot legend bugs sometimes and does not display the correct colors. Sometimes even the color in the plot legend partialy updates (shows two colors). The property node for the plot color is called from a subvi (using the graph reference of the graph in the main vi). The changes in the colors are done correcty, beacouse when I mouse over the color box, it correctly updates and displays the correct color.
10-15-2015 07:19 AM
If you attach your VI, and some sample data (perhaps "wired in" to the inputs), we could play with it and figure out why it is misbehaving (and thereby help you). Otherwise, we'd be "guessing".
Bob Schor
10-15-2015 08:19 AM - edited 10-15-2015 08:21 AM
I have made up a simplification of the problem (since my code is to large) and the problem persists aswell. Check it out.
Colors wont rotate properly in the legend. Try to mouse over the colors in the legend, they update correctly when you mouse over.
10-15-2015 08:34 AM - edited 10-15-2015 08:34 AM
Sounds like a graphical bug/glitch. I can't see anything obvious in your code.
Have you tried:
- Deferring/undeferring panel updates before/after applying the property
- Calling the 'force redraw' method on the graph (although I've always been skeptical whether or not that actually does anything)
10-15-2015 08:41 AM
I have tried with defer panel udpates and it does not work. However this works, I guess is's a fine solution (make legend not visble and then visible again forcing to update). In the prievious version of my code this section was not in a subvi and It gave no problems. It mitgth be related with that but I still want to keep it in subvi's so my code does not get messy. Ty
10-15-2015 10:01 AM
Neat thanks for sharing, just a couple of things. I do believe this is a bug, and I believe it is related to an existing NI CAR 460014.
I saw a similar issue with updating the plot legend, but I was trying to set the scroll position here. The work around I found there, also fixes your situation but your solution is probably better. I had my code call the fit to pane which caused a redraw of the whole thing, but the hide then show is probably better for several reasons.
As for the redraw method, I believe all that does is redraw the graph and not the other parts of the control, in my case it didn't help either.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord