I have combination chart where I am changing the series by based on property control but wheneve the series by is changed it changes colors of values. Can we fix the color in series by?
Try this it worked for me:
viz is the Visualization name as prarmeter for the script
from Spotfire.Dxp.Application.Visuals import CombinationChart,CombinationChartSeriesType,VisualContent
from System.Drawing import Color
chart = viz.As[CombinationChart]()
selectedyear = Document.Properties["yearSelection"] #my series is Year and the chart only shows currentyear and previous year.
colorRule = chart.ColorAxis.Coloring.AddCategoricalColorRule()
colorRule.Item[selectedyear-1] = Color.FromArgb(255,126,0) #colorRule.Item["YourSeriesValue"]
colorRule.Item[selectedyear] = Color.FromArgb(30,115,233)
Good enhancement request!
This Question already has a 'Best Answer'. If you believe this answer is better, you must first uncheck the current Best Answer