With IronPython scripts it is possible to configure and automate a lot of different aspects of a TIBCO Spotfire® analysis and add behaviors to it without creating and deploying extensions. IronPython scripts can access the capabilities available in the Spotfire Analyst API.
IronPython scripts can be added to several places in a Spotfire analysis. Scripts can be exctuted from action controls in the Text Area, from the Graphical Table or the KPI Chart or be triggered by Document Property changes.
To create an analyses containing IronPython scripts, the analyst needs the Author Scripts license function. Scripts in analysis files that are shared via the library by licensed script authors are considered as trusted. For security reasons you should always examine and approve a script that is not listed as trusted before executing it.
The Spotfire add-in mechanism for C# extensions, which enables developers to extend the Spotfire feature set, is designed for the developers with access to a full-fledged development environment. Scripting does not replace this framework. It rather supplements the heavy-lifting programming with a light-weight option to configure Spotfire and extend its behaviors, a convenient and powerful means to solve simple as well as complex tasks. Many of the script examples below are applicable also when creating custom tools and other extensions as embedded IronPython scripts or converted to C#.
- How to develop IronPython scripts and their limitations
- Using IronPython scripts in the Text Area
- Using IronPython scripts in the KPI Chart or the Graphical Table
- Using IronPython scripts with Document Properties
- Create complex user Interfaces using property controls and IronPython scripts
- Spotfire Analyst User's Guide
Other uses of Python (not IronPython) with Spotfire:
- Set custom sort order
- Invoke a pre-defined data function
- Export data
- Convert json data to csv format
- Create, execute, and save a Spotfire data function
- Add a data table with a Pivot transformation
- Set the layout of the visualizations on a page (7.8)
- Modify which columns are shown in a Table Plot
- Create and configure a KPI chart (7.8)
- Sort a Bar Chart visualization
- How to set Stack mode in Bar Chart visualizations
- How to toggle the Axis Selectors on/off in a visualization
- Convert one visualization into another
- Reset Zoomslider
- Maximize/Restore a visualization
Filtering and Marking
- Read and modify checked values in Check Box Filter
- Apply multi-select values from a property control to a filter
- Perform 'Reset All Markings'
- Perform 'Limit data shown in visualization using markings'
- Select all values from a given Document Property control
- Retrieve data marking selection
- Setting Hierarchical Filters
- Setting a specific filter
- Toggle filter panel
- Passing filter value in visualization title
- Use Regular Expression with a Filter
- Turn on a Custom Panel in Consumer/Business Author
- Use the DataPanel
- Toggle the Data Panel on/off
- Toggle (Show/Hide) curves in a LineChart
- Fetch Logged In Username
- Troubleshoot the exception thrown when executing a IronPython script with the error: Attempt take snapshot on application thread in state 'Executing'
- Communicate findings to a third party component by the click of one button
- Import custom libraries and extensions from a local directory
- Execute a custom tool
- Save the document to a file
- Execute script after data table refresh completion
- Retrieve dxp File/Library path
- Troubleshoot the error message: Script requires more arguments than supplied
- Write to MS Access database
- Export DataTable to a String
- Deploy custom Python modules
- Selecting the first available value in drop down
- Sending an email via Outlook
The script code in these articles 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 per your implementation specifications that suit best your business requirements. Refer to the API reference for usage of the classes and methods used in the scripts. All scripts on this page are covered by this license