Jump to content

I would like to swtich off the legend of a visualization with a dropdown property control, which has fixed values True and False respectively, however, I used the script below but


Stanley Wei

Recommended Posts

Dear All,

 

I would like to swtich off the legend of a visualization with a dropdown property control, which has fixed values True and False respectively, however, I used the script below but it doesn't work, here are the full codes:

 

# Hide or Show legend# Stanley Wei, May-25 2015from System.Windows.Forms import FolderBrowserDialog,MessageBoxfrom Spotfire.Dxp.Application.Visuals import TablePlot, HtmlTextArea, VisualTypeIdentifiersfrom Spotfire.Dxp.Application.Visuals import VisualContent

 

for vis in Application.Document.ActivePageReference.Visuals:

if vis.Title == "Resources allocation trend (FTE)" : rt=vis.As[VisualContent]() MessageBox.Show(Document.Properties["cbxSwitchLegend"]) rt.Legend.Visible=Document.Properties["cbxSwitchLegend"]

If I used the abosulte value True of False instead of the Property control, it will work. Any thoughts about this question

 

Thanks a lot,

Stanley

Link to comment
Share on other sites

  • 4 months later...
  • 3 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...