TIBCO Cloud™ Spotfire® Web Client User Guide

Using a property for coloring purposes

The Color by axis in the map chart feature layer below is set to the Members column in the data table to the right. All states have the same color so far, because the Color mode is set to Fixed. Assume you wish to identify states where the number of members exceeds a certain user-controlled value that you specify in a text area. For example, you might want to color all states that have more than 1000 members in green.

Before you begin

The functionality described here must be authored using the installed client.

About this task

To do this, a color rule is added to the Fixed color mode. The rule includes a property, whose value is controlled from a text area:

Procedure

  1. Create or edit a text area.
  2. In edit mode, add the property control to the text area. In this example, we add an Input field.


  3. In the Property Control dialog, create the property via New. Give it a name, specify its data type, and a starting value. In this example, we call the property 'MembersExceed'.


    No other settings are needed within the Property Control dialog.
  4. Now you can connect the property to the place that should react on changes to the property value. In this case it is a color rule on the Colors page in the Feature Layer Settings dialog. Click Add Rule, set Rule type to Greater than, and in the Value field, select Custom expression, and enter the created property ${MembersExceed} (note the syntax) below Expression.


Results

Now you can type a number in the input field in the text area, and the map chart coloring updates according to the color rule.