LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove a plot and resize the plot legend in LV 8.6 as in this link to a LV 7.0 example

Solved!
Go to solution

Calvus wrote:

I have implemented a method to shuffle the plots in the legend and was satisfied with one exception- the plot colors. This application allows the user to add or delete plots from the graph, adding a plot is easy as the new plot name gets appended to the next place on the legend and the number of rows grows by one. Deleting a plot is also quite easy but this action brought up a usability issue in that the existing plots that were shuffled on the legend would also shift their colorsaccordingly. To eliminate possible confusion I want to keep the correlation between existing plots and their assigned colors so I tried to use the plot color property to change the plot color programmatically with unexpected results.


You should just modify my original VI as follows (Mod3).

 

(I agree there is some update issue when you change the colors via an event structure)

 

As a better alternative, you might want to simply plot all graphs at all times, but make some of them transparent as needed. This has the advantage that you don't need to resize the plot legend. Resizing the plot legend seem inconvenient anyway and does not give any advantage. After all, you need to leave sufficient room for the full size legen anyway. 🙂

 

See the second example (Mod4).

Download All
Message 11 of 13
(954 Views)

Hi again and thanks to all for your suggestions.

 

I found that you need to set the properties in a particular order to be able to change the plot color when using a plot other than common plot type 0.

The order of properties in the property node should be:

ActPlot

Plot.Color

Plot.Fill/PtColor

Plot.FillTo

 

If the properties are not set in this order then the Plot.Fill/PtColor property is be ignored and the plot color remains unchanged.

The Plot.Fill/PtColor property clue was helpful in pointing me to the solution.

 

Attached is the re-factored and properly behaving VI.

 

Should the order matter here and if so, are property nodes order of operation defined or documented anywhere?

Funny how the simple bells and whistles - which should be icing on the cake - can sometimes take more time to implement than the effort that went into creating what goes on "under the hood"!

 

Thanks again!

 

Message 12 of 13
(931 Views)

Property nodes execute top to bottom, so the only property where the order matters is "active plot", which needs to be first.

 

 

 

 

Message 13 of 13
(921 Views)