Product: TIBCO Spotfire®
How to reset x-axis Zoom Slider using an IronPython script?
When the Zoom Slider is enabled for X-Axis, and the "Remember Personalized view for each user" is enabled, the Slider may be zoomed in unintentionally since it remembers the last Zoom setting. The next time, those values are no longer valid. Alternatively, if the underlying data in the visualization changes, the prior Zoom Slider setting may no longer be relevant. To counter this, you can write a script that resets the Zoom Slider and have that execute when needed. For example, every time you open the report, on filtering/marking change.
The following is a sample script showing how to reset x-axis Zoom Slider.
################################################
# This script expects one argument:
# visual - The visual (Line chart) which needs X-axis zoom reset
from Spotfire.Dxp.Application.Visuals import VisualContent
vc = vis.As[VisualContent]()
#Following 2 lines will reset the zoom slider
vc.XAxis.ManualZoom = False
vc.XAxis.ManualZoom = True
################################################
To execute this script automatically, see the following KB articles:
• KB: 45663 How to execute an IronPython script on Filter/Marking change.
• KB: 44163 How to execute an IronPython script on initial load of an analysis.
Disclaimer:
The script code in this article is only a sample to be used as a reference. It is not intended to be used "As Is" in a Production environment. Always test in a Development environment. Make modifications to the script in accordance with your implementation specifications that best suit your business requirements. Refer to the API reference(s) cited in this article for usage of the classes and methods used in the script.
https://docs.tibco.com/pub/doc_remote/spotfire/7.0.1/doc/api/
IronPython, x-axis zoom slider, Zoom Slider, reset zoom Slider
Comments
0 comments
Article is closed for comments.