Skip to content

Multimetric Trend

The Multimetric Trend as it names indicates, allows to trend multiple metrics over time. It requires one field of type TIME and at least one metric, but it's true usability comes when displaying several:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
let grid = cf.Grid().left(65).right(15).bottom(65).top(10);
let metrics = [
    cf.Metric("commission","sum"),
    cf.Metric("qtysold","sum"),
    cf.Metric("pricepaid","sum")
];
let group = cf.Attribute("saletime")
            .limit(100)
            .func("DAY")
            .sort("asc","saletime");

cf.provider("Elasticsearch");
    .source('ticket_sales');
    .groupby(group)
    .metrics(...metrics);
    .graph("Multimetric Trend")
    .set("grid", grid)
    .element('multi-trend-div')
    .execute();

The previous code will render the Trend Chart below:

MAT

All filters over the Multimetric Trend are always applied as normal filters.