Book Image

TIBCO Spotfire: A Comprehensive Primer

By : Michael Phillips
Book Image

TIBCO Spotfire: A Comprehensive Primer

By: Michael Phillips

Overview of this book

Table of Contents (18 chapters)
TIBCO Spotfire – A Comprehensive Primer
Credits
Foreword
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

How to manipulate color


Color can be applied to a visualization in one of three fundamentally different ways:

  • Category

  • Rule

  • Gradient

The use of these different approaches is constrained by visualization type, data type, and whether the data is categorical or continuous in nature. At a scripting level, the color is also handled differently for tables and cross tables, but let's start with the other visualizations: those with axes.

Color by category

Color by category is simply handled using the Spotfire.Dxp.Application.Visuals ColorAxis class we've already encountered. This class has a property called Coloring, to which we can apply a categorical color rule. As usual, the main reference object is visualContentObject.

Action

Property or Method

Create a new categorical color rule

colorRule = visualContentObject .ColorAxis.Coloring.AddCategoricalColorRule()

Add values to the color rule

colorRule .Item[Value] = Color

Value can be whatever you want but should match the anticipated values in...