Spotfire® allows the use of document properties to change the colours of a bar chart with buttons/drop down lists etc.
|
# Copyright © 2017. TIBCO Software Inc. Licensed under TIBCO BSD-style license. # Author: Andrew Berridge, February 2016 # # Example of how to map colours to categorical items in a bar chart from Spotfire.Dxp.Data import * from System.Collections.Generic import List from Spotfire.Dxp.Application.Visuals import * import System.Drawing.Color # Get a reference to a visual on the page specified def getVisual2(page, visualTitle): for vis in page.Visuals: if vis.Title == visualTitle: return vis return None # Get the bar chart barchart = getVisual2(Document.ActivePageReference, "My Bar Chart").As[barChart]() # Clear the color axis coloring barchart.ColorAxis.Coloring.Clear() barchart.ColorAxis.Categorical.ColorMap["Apple"] = System.Drawing.Color.FromName("Red"); barchart.ColorAxis.Categorical.ColorMap["Banana"] = System.Drawing.Color.FromName("Yellow");
License: TIBCO BSD-Style License
Recommended Comments
There are no comments to display.