04-05-2010 06:33 PM
Hello,
I am currently producing a XY graph based on a set of points. Along with this, I plot three trendlines that the user then will select from. When he/she selects one of the trendlines, I wish for the other two to disappear. Currently, I am able to use the Property "Plots"->"Visible" to cause the actual trendline to disappear. However, the name of the plot is still shown in the legend (although the sample of how the curve looks is blank as desired). I am wondering if there is a way to cause the name in the legend to also disappear.
I know that it is possible to use "Legend" -> "Number of Rows", but this seems to limit the plots shown in the legend based on their order. For example, if I have plots "Curve", "Trendline 1", "Trendline 2", "Trendline 3", and desire to select Trendline 3 only, setting Number of Rows to 2 will show "Curve" and "Trendline 1". I believe it is possible to take the data and reformat it so that the second plot becomes the desired trendline, but I was hoping to avoid this if possible.
I attached a small VI to show what I am doing so far.
Thanks
04-06-2010 03:36 AM
This could be a approch
1) Read all the available Plot names
2)Check how many plots needs to be visible (based on the array of boolean)
3) Use this number to decide the "number of plots"
4) based on the visible plots and the available plot names reassign the plot names to the legend
Guru
04-06-2010 03:50 AM
Something like this??
04-06-2010 11:52 AM
Hello Guruthilak,
Thank you for the reply and sample VI. While the VI that you attached was certainly better than my original, there is still the issue of the blank space existing where the trendline used to be. I also programmed the attached VI based on your first approach. The issue is that when I rename the plots to the legends, it just renames the existing trendlines. For example, if I want "Curve" and "Trendline2", the Legend will read
"Curve - <white line>"
"Trendline2 - <blank space>"
Is there an additional step that must be taken?
Thank you again for the help
04-07-2010 01:03 AM
I Tried bobby but could not get a soution for removing the blanked plot legend...
But here is anothe solution using an array of cluster..Just check whether this be of any use....
Click the boolean (actaully you can color this boolean by creating a seperate cluster of booleans (if the size of the plots are known so that programatically you can control them) for color coding) in the cluster to hide/show a plot
Guru