Class

SpotfireColorAxis

SpotfireColorAxis(colorAxisDescription)

Represents a color axis description.

Constructor

new SpotfireColorAxis(colorAxisDescription)

Parameters:
Name Type Description
colorAxisDescription Object
columns [Inherited] Array.<String>

Specifies the column or hierarchy to use for the Axis.
Note: We strongly recommend to escape the column names using square brackets (column names must be identical to the 'Edit expression' field in TIBCO Spotfire).

axisMode [Inherited] SpotfireAxisModes {Enum}

Specifies whether the column or hierarchy should be treated as continuous or categorical.

Enum options: continuous, categorical
categoryMode [Inherited] SpotfireCategoryModes {Enum}

Determines how to display the categories. 'Show filtered values': to display values available after current filtering only; 'Show filtered range': to hide empty categories on both ends of the currently visible range; 'Show all values': to keep all categories visible even if data for some categories have been filtered out.

Enum options: showFiltered, showFilteredRange, showAll
evaluationMode [Inherited] SpotfireAxisEvaluationMode {Enum}

Only applicable when the range of the available values on the axis is determined by the expression itself, that is, for column-based expressions such as ranking or binning. 'All data': to evaluate the axis expression before filtering is applied and use all of the data to calculate the available ranges; 'Current filtering only': to take the current filtering (as specified on the Data page) into account when evaluating axis expressions.

Enum options: allData, filteredData
colorMode SpotfireColorModes {Enum}

Specifies in which color mode to set up the color scheme. Which modes are available depends on whether the scale is in categorical or continuous mode. For columns in continuous scale mode, you can select one of the following color modes: Gradient, Segments, or Fixed. For columns in categorical scale mode, you can select either Categorical or Fixed color mode.

Enum options: fixed, categorical, gradient, segments, uniqueValues
oneScalePer SpotfireOneScalePer {Enum}

Specifies whether there should be one separate scale per trellis panel for trellised bar charts, or if one scale should apply to the entire visualization. Only applicable to columns in continuous scale mode.

Enum options: column, trellis
colorRules SpotfireColoringRules | Array.<SpotfireColoringRules>

Array of color rules to apply on the visualization.

type SpotfireColoringRulesTypes {Enum}

Specifies which rule type to add. Which types are available depends on the data type of the column, or hierarchy that the rule is applied to.

Enum options: top, bottom, between, equalTo, notEqualTo, greaterThan, greaterThanOrEqual, lessThan, lessThanOrEqual, booleanExpression, gradient, segments, uniqueValues, string
value Number | String

Defines the value the rule should apply to. The available options depend on the rule type.

startValue Number

Only available for the "Between" type, specifies the minimum value the rule should apply to.

endValue Number

Only available for the "Between" type, specifies the maximum value the rule should apply to.

colorPoints Object | Array.<Object>

Array of color points to apply on the visualization. Available for continuous columns only.

type SpotfireColoringRulesTypes {Enum}

Specifies which point type to add. Only types for continuous columns are available.

Enum options: top, bottom, between, equalTo, notEqualTo, greaterThan, greaterThanOrEqual, lessThan, lessThanOrEqual, booleanExpression, gradient, segments, uniqueValues, string
value Number | String

Defines the value the rule should apply to. The available options depend on the point type.

color Object

Specifies the color to use for the rule. See colorHelpers to get the proper structure (hexToARGB for instance).

Examples
const colorAxisDescription = {
    columns: ['my column'],
    colorMode: 'Fixed',
    colorRules: {
        type: 'Between',
        startValue: 1,
        endValue: 3,
        color: '#FF0000'
    }
}
const colorAxisDescription = {
    columns: ['my categorical column'],
    colorMode: 'Categorical',
    colorRules: {
        type: 'Contains',
        value: 'val_',
        color: '#FFD633',
        displayName: 'Contains val_'
    }
}
const colorAxisDescription = {
    columns: ['my continuous column'],
    colorMode: 'Gradient',
    colorRules: [
        {
            type: 'Top',
            value: 3,
            color: '#FF0000'
        },
        {
            type: 'Bottom',
            value: 3,
            color: '#FF0000'
        }
    ],
    colorPoints: {
        type: 'Median',
        color: '#FFD633'
    }
}

Methods

getExpression()

Gets the expression corresponding to the column or hierarchy to display on the axis.

setAxisMode(axisMode)

Sets the axis mode.

Inherited From:
Parameters:
Name Type Description
axisMode SpotfireAxisModes {Enum}

can be the label (GUI style) or the real enumeration value.

Enum options: continuous, categorical

setCategoryMode(categoryMode)

Sets the category axis mode.

Inherited From:
Parameters:
Name Type Description
categoryMode SpotfireCategoryModes {Enum}

can be the label (GUI style) or the real enumeration value.

Enum options: showFiltered, showFilteredRange, showAll

setColorRules(colorDescriptions)

Sets the color rules.

Parameters:
Name Type Description
colorDescriptions colorAxisDescription

setEvaluationMode(evaluationMode)

Sets the axis evaluation mode.

Inherited From:
Parameters:
Name Type Description
evaluationMode SpotfireAxisEvaluationMode {Enum}

can be the label (GUI style) or the real enumeration value.

Enum options: allData, filteredData