# barChart is a BarChart Visualizaiton script parameter
# labelInformationType is an integer document property script parameter with values 0|1 for pct or value
from Spotfire.Dxp.Application.Visuals import BarChart
barChart.As[BarChart]().SegmentLabelInformationType = labelInformationType
# if you need to toggle from percantage to value, you can do this too:
from Spotfire.Dxp.Application.Visuals import BarChart, BarChart,LabelInformationType
barChart = barChart.As[BarChart]()
barChart.SegmentLabelInformationType = LabelInformationType.Value if barChart.SegmentLabelInformationType==LabelInformationType.Percentage else LabelInformationType.Percentage
4 comments:
Another way of doing this.
from Spotfire.Dxp.Application.Visuals import BarChart,LabelInformationType
barChart=barChart.As[BarChart]()
if barChart.SegmentLabelInformationType==LabelInformationType.Percentage:
barChart.SegmentLabelInformationType=LabelInformationType.Value
else:
barChart.SegmentLabelInformationType=LabelInformationType.Percentage
Thanks Aditya for your suggestion. I added that option on the post.
Thank you For suggestion.
Could you please suggest same for line chart
how to Change line chart labels from percentage to value?
Checkout my friends site. It has plenty of examples https://sf-ref.com/
Post a Comment