sisense.com

Indicator Object

The indicatorInstance object represents an Indicator widget.

You can modify the styling of an Indicator widget through the indicatorInstance object's setOptions method.

The following images display labels that define all the elements you can customize for each type of Indicator widget.

Gauge

Gauge Indicator widget with labels for each customizable element

Numeric Simple

Numeric Simple Indicator widget with labels for each customizable element

Numeric Bar

Numeric Bar Indicator widget with labels for each customizable element

Methods

setOptions

indicatorInstance.setOptions(type, options)

Defines styling options for an Indicator widgets.

Arguments

NameTypeRequiredDescription
typestringYesOne of: gauge, numericSimple, numericBar, ticker
optionsIndicatorOptionsYesIndicator styling configuration

Returns

N/A

Example

widget.on('initialized', function(w) {
    var options = {
        title: {
            fontFamily: 'Helvetica, sans-serif',
            fontWeight: 'bold',
            fontSizes: {
                big: 40,
                medium: 30
            },
            color: '#29aba4'
        },
        value: {
            fontFamily: 'Helvetica, sans-serif',
            fontStyle: 'italic',
            color: '#e9e0d6'
        },
        bracketColor: '#f2ae72'
    };
    w.indicatorInstance.setOptions('numericBar', options);
});

Types

IndicatorOptions

These properties applies to all Indicator widget types:

NameTypeDescription
titleIndicatorComponentStyleSet of options to style the title section of an Indicator widget
valueIndicatorComponentStyleSet of options to style the value section
secondaryTitleIndicatorComponentStyleSet of options to style secondaryTitle section
secondaryValueIndicatorComponentStyleSet of options to style secondaryValue section
backgroundColorstringBackground color of the indicator widget

Gauge Indicator widget specific properties:

NameTypeDescription
labelIndicatorComponentStyleSet of options to style label sections
needleColorstringColor of the needle
tickColorstringColor of the ticks
bracketColorstringColor of the brackets

Numeric Simple Indicator widget specific properties:

NameTypeDescription
borderColorstringColor of the border

Numeric Bar Indicator widget specific properties:

NameTypeDescription
bracketColorstringColor of the brackets

Ticker Indicator widget specific properties (Note, that ticker properties will be used by all the indicator types' tickers):

NameTypeDescription
dividerColorstringColor of the divider
barHandleColorstring(only for gauge type) Color of the bar handle

IndicatorComponentStyle

Each element of the Indicator specified above can have the following style settings

NameTypeDescription
fontStylestringSpecifies the font style. One of: normal, italic, oblique
fontVariantstringSpecifies the font variant. One of: normal, small-caps
fontWeightstring or integerSpecifies the font weight
fontFamilystringSpecifies the font family. You can also specify it as a set of the main font and fallback fonts divided by a comma
colorstringSpecifies the color of the text
fontSizesobject(only for main types) Specifies font sizes for different indicator size variants
fontSizes.bigstring or integerSpecifies the font size for the big indicators, in pixels
fontSizes.mediumstring or integerSpecifies the font size for the medium indicators, in pixels
fontSizes.smallstring or integerSpecifies the font size for the small indicators, in pixels
fontSizes.microstring or integerSpecifies the font size for the micro indicators, in pixels
fontSizestring or integer(only for ticker type) Specifies the font size, in pixels

Note: You can specify font sizes as a number or as a string (number plus 'px': 200px)

Last Updated: