I have written a Iron Python script for Pie chart label settings changing, same as i need for bar chart can you please help me on this.

Hi All,

Code is pasted here,

from Spotfire.Dxp.Application.Visuals import *
from Spotfire.Dxp.Data import DataPropertyClass
LabelSettings = Document.Data.Properties.GetProperty(DataPropertyClass.Document,"LabelSettings")
LabelSettings = LabelSettings.Value
print LabelSettings
#visuals = Document.ActivePageReference.Visuals from Spotfire.Dxp.Application.Visuals import *
visuals = Document.ActivePageReference.Visuals 
for vis in visuals:
    if vis == varViz:
        PieChart = vis.As[PieChart]()
        if LabelSettings == 'Number':
            PieChart.VisualAttributes.LabelPercentage = 0
            PieChart.VisualAttributes.LabelValue  = 1
        if LabelSettings == 'Percentage':
            PieChart.VisualAttributes.LabelPercentage = 1
            PieChart.VisualAttributes.LabelValue  = 0

(1) Answer

Login