Paul Shumaker Posted September 13, 2019 Share Posted September 13, 2019 Hello, I'm currently working on a visualization that needs to conditionally color individual bars in a combination chart based on the bar's value. I did not see any options in the properties dialog, just "Series" coloring. This is my progress so far: from Spotfire.Dxp.Application.Visuals import * from System.Drawing import Color print "test" pg = Document.Pages[0] vis = '' for v in pg.Visuals: if v.Title == "Monthly Trend": vis = v.As[CombinationChart]() #print vis.YAxis.Expression vis.ColorAxis.Coloring.Clear() colorRule1 = vis.ColorAxis.Coloring.AddCategoricalColorRule() I've checked the documentation and can't really find anything on this so far. I'm not sure if it's even possible. My code so far just resets coloring back to default blue if I've created a series with a different color. Any help would be appreciated. Link to comment Share on other sites More sharing options...
Shandilya Peddi Posted September 13, 2019 Share Posted September 13, 2019 See the sample script in the following article and see if it helps in your case, https://community.spotfire.com/wiki/ironpython-script-bar-chart-colouring Link to comment Share on other sites More sharing options...
Paul Shumaker Posted September 16, 2019 Author Share Posted September 16, 2019 Thank you for the idea but that didn't work. The issue with a combination chart is that the series / axis mode must be categorical. I have to have a continuous axis mode to be able to color individual bars based on their values. I think as of now, Spotfire cannot do what I asked. I was able to add a coloring expression rule but it only worked for all bars or no bars since the total was rolled up into a category, hence the nature of combination charts and categorical axis mode.As a workaround, I will be trying to create a bar chart with a continuous axis mode, and a custom line based on the line from my combination chart. Hopefully this will help anyone in the future with similar issues. Link to comment Share on other sites More sharing options...
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