Jump to content

I am trying to build a coloring for a Table Chart from iron python code.


Steven Paynter

Recommended Posts

Hello all,

I am trying to build a coloring for a Table Chart from iron python code. So far I have been able to:

1. Create a "Color scheme grouping"

2. Add expression rules to the "Color scheme grouping"

 

How would I add a column to the "Color scheme grouping" with iron python.

 

Below is my current code for reference:

 

from Spotfire.Dxp.Application.Visuals import TablePlot, CategoryKeyfrom Spotfire.Dxp.Application.Visuals.ConditionalColoring import ConditionValuefrom Spotfire.Dxp.Data import DataTypefrom System.Drawing import Color

#clear any pre existing coloringsViz = selectTopicViz.As[TablePlot]()Viz.Colorings.Clear()

 

#Set default coloring valuescoloring = Viz.Colorings.AddNew("TopicDetails")coloring.DefaultColor = Color.Whitecoloring.EmptyColor = Color.White

 

#loop through list of names. each name should be colored greenfor name in range(0, len(list)): coloring.AddExpressionRule("[TS1_NAME]='"+list[name]+"'",Color.Green)

#add coloring to VisualizationcategoryKey1 = CategoryKey("M1")Viz.Colorings.AddMapping(categoryKey1, coloring)

 

Thanks,

Steve

Link to comment
Share on other sites

  • 2 years later...
  • 11 months later...

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...