Constructor
new SpotfireColoringTable()
Examples
const coloringDescription = {
name: 'IDNUMBER',
mappings: ['IDNUMBER'],
colorMode: 'Fixed',
defaultColor: '#FF0000'
}
const coloringDescription = {
name: 'IDNUMBER',
mappings: ['IDNUMBER'],
colorMode: 'Fixed',
defaultColor: { a: 255, r: 255, g: 0, b: 0 }
}
const coloringDescription = {
name: 'New grouping 1',
mappings: ['CLUSTER', 'CL_SIZE'],
colorMode: 'Categorical',
applyTo: 'Text',
colorRules: [{
type: 'Equal to',
value: 1,
color: '#FF0000'
}]
}
Methods
setApplyTo(applyTo)
Sets the Apply to property.
Parameters:
Name | Type | Description |
---|---|---|
applyTo
|
string | Label or enumeration value of the Apply to property. From enum |
setColorMode(colorMode)
Sets the Color mode property.
Parameters:
Name | Type | Description |
---|---|---|
colorMode
|
string | Label or enumeration value of the Color mode property. From enum |
setColorRules(colorDescription)
Sets the color rules.
Parameters:
Name | Type | Description |
---|---|---|
colorDescription
|
ColorAxisDescription ▼ | |
[ columns ]
|
String | Specifies the column or hierarchy to color by. |
[ colorMode ]
|
SpotfireColorModes ▼ | Specifies in which color mode to set up the color scheme. Which modes are available depend 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. |
fixed
|
String | Available as an option for columns in both categorical scale mode and continuous scale mode. In fixed mode, all items in the visualization will get a single, fixed color. Other available value: 'Fixed'. |
categorical
|
String | Available for columns in categorical scale mode, and gives each value in the column a separate color. Other available value: 'Categorical'. |
gradient
|
String | Available for columns in continuous scale mode. In this mode the items will show a color gradient between two or more anchor points. Other available value: 'Gradient'. |
segments
|
String | Available for columns in continuous scale mode. This will color the items representing values between two or more anchor points in fixed colors. Other available value: 'Segments'. |
uniqueValues
|
String | Available for columns in continuous scale mode. It is similar to the Categorical color mode, and gives each unique value in the column a separate color. Other available values: 'UniqueValues', 'Unique values'. |
[ defaultColor ]
|
String | Color ▼ | Specifies the default color to be used, in the hexadecimal format, with color name, or the ARGB object. Especially used with the 'Fixed' color mode. |
a
|
Number | Opacity factor, between 0 and 255. |
r
|
Number | Red intensity, between 0 and 255. |
g
|
Number | Green intensity, between 0 and 255. |
b
|
Number | Blue intensity, between 0 and 255. |
[ oneScalePer ]
|
SpotfireOneScalePer ▼ | 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. |
column
|
String | To have one separate scale for each column in the color scheme grouping, or to have one common scale applied to all the columns. Other available value: 'Column'. |
trellis
|
String | To have one separate scale per trellis panel for trellised visualizations. Other available value: 'Trellis'. |
[ templateLibraryPath ]
|
String | The path in the library of the file that contains a color scheme to be applied to the visualization. |
[ templateUrl ]
|
String | The URL of the file that contains a color scheme to be applied to the visualization. |
[ templateName ]
|
String | The name of the document color scheme. |
[ colorRules ]
|
Array.<ColorRule> ▼ | Array of color rules to be applied on the visualization. |
[].color
|
Color ▼ | |
a
|
Number | Opacity factor, between 0 and 255. |
r
|
Number | Red intensity, between 0 and 255. |
g
|
Number | Green intensity, between 0 and 255. |
b
|
Number | Blue intensity, between 0 and 255. |
[].type
|
SpotfireColoringRulesTypes ▼ | |
top
|
String | |
bottom
|
String | |
between
|
String | |
equalTo
|
String | |
notEqualTo
|
String | |
greaterThan
|
String | |
greaterThanOrEqual
|
String | |
lessThan
|
String | |
lessThanOrEqual
|
String | |
booleanExpression
|
String | |
gradient
|
String | |
segments
|
String | |
uniqueValues
|
String | |
string
|
String | |
[].displayName
|
String | Optionally specify a descriptive name for the rule. The name is used to identify the rule in the Visualization Properties dialog, and it can be displayed in the legend of the visualization. Leave the field blank if you want to use the default rule name. |
[].color
|
String | Color ▼ | Specifies the color to be used for the rule, in the hexadecimal format, with color name, or the ARGB object. |
a
|
Number | Opacity factor, between 0 and 255. |
r
|
Number | Red intensity, between 0 and 255. |
g
|
Number | Green intensity, between 0 and 255. |
b
|
Number | Blue intensity, between 0 and 255. |
[ [].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. |
[ [].expression ]
|
String | Only available for the "Boolean expression" type. Specifies the expression the rule should apply to, all the items for which the expression is true will get the specified color. |
[ colorPoints ]
|
Array.<ColorRule> ▼ | Array of anchor points to be applied on the visualization. Available for continuous columns only. |
[].color
|
Color ▼ | |
a
|
Number | Opacity factor, between 0 and 255. |
r
|
Number | Red intensity, between 0 and 255. |
g
|
Number | Green intensity, between 0 and 255. |
b
|
Number | Blue intensity, between 0 and 255. |
[].type
|
SpotfireColoringRulesTypes ▼ | |
top
|
String | |
bottom
|
String | |
between
|
String | |
equalTo
|
String | |
notEqualTo
|
String | |
greaterThan
|
String | |
greaterThanOrEqual
|
String | |
lessThan
|
String | |
lessThanOrEqual
|
String | |
booleanExpression
|
String | |
gradient
|
String | |
segments
|
String | |
uniqueValues
|
String | |
string
|
String | |
[].displayName
|
String | Optionally specify a descriptive name for the rule. The name is used to identify the rule in the Visualization Properties dialog, and it can be displayed in the legend of the visualization. Leave the field blank if you want to use the default rule name. |
[].color
|
String | Color ▼ | Specifies the color to be used for the rule, in the hexadecimal format, with color name, or the ARGB object. |
a
|
Number | Opacity factor, between 0 and 255. |
r
|
Number | Red intensity, between 0 and 255. |
g
|
Number | Green intensity, between 0 and 255. |
b
|
Number | Blue intensity, between 0 and 255. |
[ [].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. |
[ [].expression ]
|
String | Only available for the "Boolean expression" type. Specifies the expression the rule should apply to, all the items for which the expression is true will get the specified color. |
setDefaultColor(defaultColor)
Sets the default color property.
Parameters:
Name | Type | Description |
---|---|---|
defaultColor
|
String | ColorDescription ▼ | Default color in the hexadecimal format, with color name, or the ARGB object. |
a
|
number | Opacity factor, between 0 and 255. |
r
|
number | Red intensity, between 0 and 255. |
g
|
number | Green intensity, between 0 and 255. |
b
|
number | Blue intensity, between 0 and 255. |
setOneScalePer(oneScalePer)
Sets the One scale per property.
Parameters:
Name | Type | Description |
---|---|---|
oneScalePer
|
string | Label or enumeration value of the One scale per property. From enum |