Group

App.Chart.DataType. Group

Transforms data in neutral format to data serie format using a grouping strategy. The objects are grouped by a configured expression. Each unique value gets one label and the amount of objects is the data value. It expects there to be one dataserie in the configuration.

Constructor

new Group()

Methods

(static) go(config) → {Array}

Example
Returns data on format:
{
    'labels': ['<label>', '<another-label>', ...],
    'series': [{
        'name': '<name>',
        'data': [{
            'value': <value>
            'objectIds': [
                '<object-id>',
                '<another-object-id>',
                ...
            ]
        },{
            ...
        }]
     },{
        ...
    }]
}
Parameters:
Name Type Description
config Object

Chart configuration

Returns:

Data series

Type
Array

(static) top(data, config) → {Array}

Returns top entries in the dataserie based on the value.

Parameters:
Name Type Description
data Array

Grouped data

config Object

Chart configuration

Returns:

Data series reduced to only top number of entries and other entry for the rest

Type
Array