LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot color retention

Is there a way to get a graph to remember the colors that assigned to it? When I drop a graph on the FP the colors repeat in batches of 10. I have 16 plots. I know it's easy to change the plot colors , but if the user clears the plot, then the colors revert back to the default. Rather than having to trap the clear event and possibly others that reset the colors, it'd be nice if I could tell the graph to use the default colors that I assigned. Is this possible?
 
George
0 Kudos
Message 1 of 6
(2,657 Views)

You can just use a property node to set the colors. First set the active plot and then assing the color.

Message Edited by Dennis Knutson on 03-17-200607:34 AM

0 Kudos
Message 2 of 6
(2,655 Views)

Thanks, but that doesn't really answer the question. Please reread my post. The plot colors aren't retained after the user clears the graph. I need a way to make the graph remember the colors which it doesn't seem to do.

George

0 Kudos
Message 3 of 6
(2,646 Views)
You mean the user simply right clicks on the chart/graph and selects Clear Graph and the plots colors change? That's behavior I don't see (at least in LabVIEW 7.1). What version are you using? Can you post a VI that demonstrates this behavior?
0 Kudos
Message 4 of 6
(2,639 Views)

I'm using LV 8.0.1. I just built a simple VI to post, but the colors aren't cleared in that VI. It might take awhile to recreate what's actually happening in my real VI. The sequence of events occurring there is more like this:

Data is graphed and the colors are changed to what I want.

Data is saved to disk.

If the graph is cleared, the data loaded back from disk and sent to the graph then the default colors (not the ones I assigned) are used. Actually I think the default colors are used if the data is just reloaded (no clear necessary). I'm doing the updates in a subvi via references so maybe that has something to do with it.

This reloading is what I tried to duplicate in the example VI (although in a different fashion), but the colors don't change there. Seems like I have more investigating to do.

Maybe my question should be this - if you set the plot colors should they be retained even when you send new data to the graph? If so, then something is happening in my VI that upsets that balance.

George

0 Kudos
Message 5 of 6
(2,633 Views)
Simply clearing the graph should not change the colors. I don't think a Reinitialize to Default will change the colors but thn I'm still stuck with LabVEIW 7.1. Are you doing anything in the subVI like changing the number of plots or creating new ones? If the plot count is fixed, then I don't understand why the colors would change. If you start out with 0 plots and add them as required, then it makes sense. If that's the case, before you do the add/create, you might want to do a read of the number of plots and get their colors so that you can set them.
0 Kudos
Message 6 of 6
(2,626 Views)