Jump to content

IronPython Script code for altering a particular Series color in a Combination Chart

Go to solution Solved by Jose Leviaguirre,

Recommended Posts

  • Solution


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
#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 by Jose Leviaguirre
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...