Grant Baker Posted June 18, 2020 Share Posted June 18, 2020 I have a bar chart that I want users to be able to sort bars by value or not by using a drop-down property control. In other words, the property control would toggle the "sort bars by value" option on and off. Is there an IronPython script that I can write in a document property to control this Thanks in advance. Link to comment Share on other sites More sharing options...
Tom Forbes 2 Posted June 19, 2020 Share Posted June 19, 2020 I use a button "action control" instead of a drop-down property control in a Text area. Clicking the button toggles sort bars by value onand off for all bar charts on a page using thefollowing script: from Spotfire.Dxp.Application.Visuals import * from Spotfire.Dxp.Data import Range for rVis in Application.Document.ActivePageReference.Visuals: if rVis.TypeId==VisualTypeIdentifiers.BarChart: #Sort bars by value vc=rVis.As[Visualization]() if vc.SortedBars == True: vc.SortedBars = False else: vc.SortedBars = True Link to comment Share on other sites More sharing options...
Grant Baker Posted June 19, 2020 Author Share Posted June 19, 2020 Worked perfectly. Thank you! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now