Introducing the all-new TIBCO Community site!

For current users, please click "Sign In" to reset your password and access the enhanced features. If you're a first-time visitor, we extend a warm welcome—click "Sign Up" to become a part of the TIBCO Community!

If you're seeking alternative community sites, explore ibi, Jaspersoft, and Spotfire.

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