Prashant S A Posted July 8 Posted July 8 Hi Team, I use cross table where there is a need to switch the values based on color by property (shown in screenshot). I don't see any API property to control this, any suggestions would help.
David Boot-Olazabal Posted July 8 Posted July 8 Hi Prashant, Can you elaborate a bit more on the above? What are you trying to achieve? And where does the API comes in play? And how does the rest of the data & configuration look like? Kind regards, David
David Boot-Olazabal Posted July 9 Posted July 9 Hi Prashant, Perhaps this topic can help you out as well: Kind regards, David
Prashant S A Posted July 9 Author Posted July 9 (edited) Hi David, Thanks for helping out. What I am looking for is, how to switch between 'cell values' and 'Region' here in cross table using Iron python script.(attached image below) Edited July 9 by Prashant S A
David Boot-Olazabal Posted July 9 Posted July 9 Right, that clarifies it a lot. Thanks for that. May I ask what your Spotfire version is? Kind regards, David
Solution David Boot-Olazabal Posted July 10 Solution Posted July 10 Hi Prashant, My colleague has created a working script for this. Since you're on 12.0.3 and we work in Spotfire 14, I'll add the script and explain what we have done. The solution comprises of 3 steps: - Add a new text area; - set up a document property called colorBy (see screenshot below). This is a drop down list property with Fixed values (you should replace the Region row with your own variable name and add others if needed); - create a new script in which you add a parameter for the crosstab (in the script, this is the cross_table). This script should be added to the text area in the form of a button (in the screenshot below, this is the 'change' button. from Spotfire.Dxp.Application.Visuals import * import System.Drawing.Color as Color cross_table = cross_table.As[CrossTablePlot]() colour_property = Document.Properties['colorBy'] categoryKey=CategoryKey(colour_property) cross_table.ColorCategory = categoryKey Now, when you select one of the values from the drop down list and hit the change button, you will see that the coloring changes slightly, since the Color by has changed from (Cell values) to Region (in our example). If needed, you can let the script run automatically upon changing the document property colorBy, by adding the script to the property via the Script button (see screenshot). Hope this helps you. Kind regards, David 1
Prashant S A Posted July 10 Author Posted July 10 Hi David, Thank you very much, its working as expected.
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