Python scripts does not work completely
I run into a bit strange issue when using python in Spotfire 6.5. When running the script in Edit Script window (click on Run Script) or via a button, it works fine.
But when I attached the script to a document property to trigger on change, only part of the script works.
Has anyone encounter something similar?
Edit: added script. This cript run just fine in the edit window or via a button, but if attached to a property control, it does not work on value change.
from Spotfire.Dxp.Application.Visuals import * #color the chart using same scheme myColors = [['Yield',0] ,['Capacity',0] ,['Crude Stream',0]] #loop through each page to get the coloring scheme of bar chart for p in Document.Pages: for myC in myColors: if p.Title == myC: for v in p.Visuals: #get the bar chart if v.TypeId == VisualTypeIdentifiers.BarChart: #get the coloring scheme myC = v.As[VisualContent]().ColorAxis.Coloring for v in p.Visuals: #get the pie chart if v.TypeId == VisualTypeIdentifiers.PieChart: #apply coloring scheme v.As[VisualContent]().ColorAxis.Coloring.Apply(myC)