Metric Views

Two up

Display two metrics side by side using the twoup metric type. This allows you to group 2 metrics together so they can be compared easily. This severely limits the amount of space for each metric, so make sure this is only used for concise values.

Supported child metrics: Short text, absolute, currency, relative, line chart, bar chart, column chart, range column chart, range bar chart, and scatterplot.

Metric actions are not supported on child metrics, just on the twoup itself.

Example:

{
  "id": "AvgSpend",
  "title": {
   "type": "static",
   "value": "Two up numbers"
  },
  "type": "displayTwoUp",
  "value": {
   "type": "array",
   "values": [{
     "title": {
       "type": "static",
       "value": "Currency"
     },
     "type": "numberCurrency",
     "value": {
       "type": "static",
       "value": 49
     }
   },{
     "title": {
       "type": "static",
       "value": "Relative"
     },
     "type": "numberRelative",
     "value": {
       "type": "static",
       "value": 9
     }
   }]
  }
}

../_images/two-up.png

Horizontal Stack

To display related content horizontally, use the displayHorizStack type. This is identical to displayTwoUp in structure, but allows for any number of items.

All metric types except for horizontal stack are supported. This should not be used as the only root metric in a tool.

Metric actions are not supported on child metrics, just on the displayHorizStack itself.

Summary Stack

The displaySummaryStack is a summary metric-specific display type, and will not work on detail views. This is identical to displayTwoUp in structure, and is used to group and display 2 metrics together.

If this metric does not define a title, the display title for the metric will be the titles for the children metrics.

The metric itself can have a sentiment to show overall sentiment. In addition, each child metric may define its own sentiment. Sentiment is not inherited by the children.

Preferred layout

metric.preferredLayout = {}

In some instances, you may find that the default layout doesn’t work for a metric. You can use the preferredLayout attribute to state how you would like the app to layout a metric. The app will try to accommodate that, but may not always be able to due to screen size, metric type, or other constraints.

KPI

This is the default type, and is designed to show users a limited amount of high level data. This will take up more screen space, and is designed for views where there are 3-5 KPIs.

KPI layout will be supported by all metrics, and if a preferredLayout is not set, the app will use this layout.

Example:

{
  "id": "AvgSpend",
  "title": {
    "type": "static",
    "value": "Currency metric"
  },
  "preferredLayout": {
    "type": "static",
    "value": "kpi"
  },
  "type": "numberCurrency",
  "value": {
    "type": "field",
    "field": "abs"
  }
}

Inline

This is a more condensed layout, where the title and metric will be on the same line. The title and metric should be very succinct. This works particularly well inside the horizontal stack metric.

This is only supported by a small number of metrics- this is currently limited to numberAbsolute, numberCurrency, numberRelative and textShort.

Example:

{
  "id": "AvgSpend",
  "title": {
    "type": "static",
    "value": "Currency metric"
  },
  "preferredLayout": {
    "type": "static",
    "value": "inline"
  },
  "type": "numberCurrency",
  "value": {
    "type": "field",
    "field": "abs"
  }
}