Jump to content

Ironpython for cross table color


Fabio Ruggeri

Recommended Posts

  • 4 weeks later...

Hi,

This is an old script to change colors of a crosstable. It should work fine, you have to play around with the setting to get to what you want but this would help you get started:

 

from Spotfire.Dxp.Application.Visuals import CrossTablePlot,CategoryKey

from Spotfire.Dxp.Application.Visuals.ConditionalColoring import ConditionValue

from Spotfire.Dxp.Data import DataType

from System.Drawing import Color

vc = vis.As[CrossTablePlot]()

coloring = vc.Colorings.AddNew("MyColorRule")

coloring.DefaultColor = Color.White

coloring.EmptyColor = Color.White

coloring.AddThresholdColorRule(0,ConditionValue.CreateLiteral(100,DataType.Integer),Color.FromArgb(255,0,0))

categoryKey1 = CategoryKey("M1")

categoryKey2 = CategoryKey("M2")

vc.Colorings.AddMapping(categoryKey1, coloring)

vc.Colorings.AddMapping(categoryKey2, coloring)

 

 

 

 

Regards,

Raghav

Link to comment
Share on other sites

  • 3 weeks later...

Thanks Raghav, I tried to use this script, but I don't get how I can use it to change cross table header.

I would need to know how I can style a header of a cross table individually and also its column values individually. This iswhat I can do with the functions implemented in Spotfire 10.10 (please see attached image), but I need to do that via ironpython (because cross table header can change dynamically).

Thanks

Fabio

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