LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot legend not refreshing

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. 

0 Kudos
Message 1 of 6
(3,702 Views)

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

0 Kudos
Message 2 of 6
(3,695 Views)

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.

Download All
0 Kudos
Message 3 of 6
(3,679 Views)

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)


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 6
(3,666 Views)

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

Download All
Message 5 of 6
(3,662 Views)

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.

0 Kudos
Message 6 of 6
(3,644 Views)