07-23-2014 08:32 PM
I am building an application that can have anywhere from 3 to 38 plots displayed on a single XY graph. When the legend gets to be taller than the graph itself I will limit the height of the legend and display a scroll bar. The problem I'm running into is that once I've run the application with 38 plots, all 38 stay in the legend list even if I run with only 5 plots. How do I clear the legend so it is limited to the number of actual plots being displayed? I have tried the 'obvious' property nodes with no luck.
I've attached a program that displays the issue.
07-23-2014 10:14 PM
hide the legend scrollbar unless the number of plots is above a certain limit.
07-24-2014 06:44 AM
altenbach,
That works for the use cases upto about 20 plots. With more than 20 plots the legend would be taller than the graph and I need the scroll bar so I can keep the legend no taller than the graph and still get to all the plots. I kept the scroll bar with the 5 plot case to demonstrate the behavior -- sorry for the confusion. If I have a scroll bar all the 'extra' unused plots are at the bottom of the legend, no matter the value of 'Legend: Number of Rows', or the number of plots I'm actually writing to the graph. It is those extras at the bottom of the legend I want to get rid of.
Steve
07-24-2014 02:21 PM - edited 07-24-2014 02:22 PM
Hi Steve,
The secret is to write a value to Property: Legend: Plot Minimum. This will get you very close to the functionality that you are looking for, with the exception that a single empty element will be added to the end of the legend. I am not sure if/how you can remove that empty element.
07-24-2014 08:48 PM
MStewart,
Thank you. The empty element I'm willing to live with. Your solution gets me to where I want to be. Thanks again.
Steve