LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set Visible Plot name and Color in Plot Legend rows Of XY graph

Solved!
Go to solution

Hi All,

 

I am initializing the XY graph with 20 plots and updating 20 plots  data on that.

 

After updating data, i am making plot 3 to unvisible, Now I need to plot legend to arrange in such a way that  it should have ,plot 0,plot1,plot2,plot4,plot 5.....plot19,  in its Plot legend and should not have Plot3.

 

So while printing the graph and viewing the graph in pdf ,i can see the plot names only for Visible plot in pLot legend  and can avoid the confusion of having plot3 in my Graph print.(Since that plot is unvisible and data for pot 3 wont be in graph and so I dont what that in my print as well)

 

Is their are ways to achieve,Please provide your suggestions.

 

 

 

Thanks,

Selvan 

0 Kudos
Message 1 of 5
(2,729 Views)

Attached is a VI that will do what you want...to a point.  It has a couple problems (won't update the graph until you change the Boolean array, plot legend location) but it shows the idea.  You'll need to adjust the legend position based on the number of rows via a property node.

 

 

 

0 Kudos
Message 2 of 5
(2,715 Views)

Hi Zwried,

 

Thanks for that.

But you see when we make any plot invisible (For Example:Initialy let the Graph have 5 plot and have it own plot colors and names, Now if I make plot C (means Plot 2 ) as invisible ,it color Green get assigned to Plot D and Plot D color get assigned to Plot E, which is my problem),

 

I just need the Plot C () to go away from legend and other plot to get aligned (Which is working perfect here) ,but without color change .

 

I tried the same and got same response.

 

Is their is any ways to avoid that?

Please suggest to get expected  output

 

thanks,

Selvan

0 Kudos
Message 3 of 5
(2,706 Views)
Solution
Accepted by topic author Dskp

You can set the plot colors, point style, etc programmatically as I did with the plot name. Colors are just an extension of the concept I used with the names array.

 

0 Kudos
Message 4 of 5
(2,701 Views)

Hi ,

 

Thanks a lot for that.

 

It helped me.

 

thanks,

 

Selvan

0 Kudos
Message 5 of 5
(2,691 Views)