Jump to content

Property control for toggling "sort bars by value" on and off.


Grant Baker

Recommended Posts

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

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

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...