Jump to content

Color By Custom Expression

Evan Roback

Recommended Posts


I am trying to color a scatter plot in Spotfire based on a filtered heirarchy value so that the column by which the data is colored changes with different heirarchy toggle values. For example, when the heirarchy toggle is set to "By Reservoir & Well", I want the data in the scatter plot to be colored by the column "FORMATION". However, when I switch to "By Well" in the heirarchy toggle,I want the data to be colored by "FIELD", which is a different column in the same data table.

I have tried using custom expressions to set the color by column but haven't been able to make it work. Thank you for your help!



Link to comment
Share on other sites

I am not sure I understand where this hierarchy lives in the plot. I assumed it was the x column. If not, please upload an example of what you need.

You can try a workaround by defining a document property via e.g. a slider in a text area. This property (say it is called hlevel) is an integer which controls both your hierarchy level and your colour expression.

Initially your x axis would look like:


You swap 0 for ${level}:


Then you define the colour expression as:


It did not work for me if Formation and Field are not both categories, because the needed to be on the outside, maybe I have not tried all combinations. But that should be good to get you started.

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