mdettm Posted February 8 Posted February 8 I am looking for code to use in an IronPython script that will allow a particular Series color in a Combination chart to be changed. Is it possible? Example attached.
Solution Jose Leviaguirre Posted February 10 Solution Posted February 10 (edited) Hello, You can change the color with IronPython by using the Coloring. SetColorForCategory Method from Spotfire.Dxp.Application.Visuals import CombinationChart, CategoryKey from System.Drawing import Color #cast visual to combo chart combinationChart = vis.As[CombinationChart]() #get script parameters from doc props category = CategoryKey(Document.Properties["category"]) #string representing a category from the series color = Color.FromName(Document.Properties["color"]) #named color such as blue, green, magenta, beige... # change the color for the corresponding category combinationChart.ColorAxis.Coloring.SetColorForCategory(category,color) #color = Color.FromArgb(255,0,0) #if you know the rgb values #hex_color = "#FF0000" #color = Color.FromArgb(int(hex_color[1:3], 16), int(hex_color[3:5], 16), int(hex_color[5:7], 16)) #if you know the hex color Here is an article on how to do so Edited February 10 by Jose Leviaguirre
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now