I'm trying to create an IronPython script that can remove all the columns from my Graphical Table, add a column with Icons and assign a specific action to this icon whenever it's clicked.
Unfortunately, I still have not found on Spotfire API the part on how to add the action programmatically.
Here is my current core:
from Spotfire.Dxp.Application.Visuals import *
from Spotfire.Dxp.Application.Visuals.Miniatures import *
from System.Drawing import Color
for vis in Document.ActivePageReference.Visuals:
if vis.Title == 'Selected Period':
viz = vis.As[GraphicalTable]()
# Remove all columns:
for c in viz.Columns:
viz.Columns.Remove(c)
# Add Icon Column
(status,NewColumn) = viz.Columns.AddNew[IconMiniatureVisualization]()
NewColumn.AutoConfigure()
NewColumn.Title = 'Icon'
NewColumn.IconAxis.Rules.Clear()
NewColumn.IconAxis.Rules.AddExpressionRule("1=1", Color.FromName("Green"), MarkerShape(MarkerType.Plus))
Does anyone know how to solve this?
Thanks!