LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mixed Signal Graph plot legend colors not updating when set with property node

Solved!
Go to solution

Hi,

 

We are trying to set the plot colors of a Mixed Signal Graph using a property node. Although we can change the color of the data on the plot correctly, the plot colors in the legend do not change until some seemingly unrelated operator action is performed (e.g., resize window, or double-clicking a plot name).  XY Graphs and Waveform Charts do not seem to have this issue.

 

Anyone know a workaround?  I think I saw a similar topic on the forums a while back, but I apologize that I am unable to find it now 😞

 

See attached vi.

 

Thanks,

-john

0 Kudos
Message 1 of 5
(3,424 Views)

JBoyd,

 

I was able to fix this by enforcing data flow so that the change in colors happens before you write data.  There seems to just be a weird interaction because of that race condition between writing data and changing colors.

 

Definitely a weird interaction.  Interstingly if you export the image, the legend of the exported image will have the same colors of the graph even if the VI does not.

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 5
(3,418 Views)

Interesting - I tried printing the window to a file and yes, the colors are correct, even though the front panel still shows the original colors !

We are looking at various workarounds, like triggering an event internally to change the pane size by one pixel or something like that.  But it's still odd that other graph types are not affected.  Curious as to what workaround you came up with ... Thanks,

john

(normally in FL but in MO for a while)

0 Kudos
Message 3 of 5
(3,395 Views)
Solution
Accepted by topic author JBoydFL

I probably should have attached the VI last post but all I did was put an error wire between the two loops.  I also deleted the text you had so I could see the button I needed to press.

Matt J | National Instruments | CLA
Message 4 of 5
(3,389 Views)

I see ... populating the graph with data will trigger processing of the property node to set the colors.  Not sure if we will know how many active plots there will be before the data is read, but that's good to know in any case, thanks!  And sorry about the "GO" button -- I don't know why it got in that position.

 

Anyway, I also added a barely noticeable adjustment to the panel size (and back to original), which makes the colors change correctly.

0 Kudos
Message 5 of 5
(3,383 Views)