Charts

How to customize custom metrics charts?

To customize the custom metrics charts, edit the plugin JSON ui section and the chart definitions.

UI section in plugin.json
Download
"ui": {
  "charts": [
    {
      "group": "Trigonometric functions",
      "title": "sinus",
      "series": [
        {
          "key": "baseSin",
          "aggregation": "avg",
          "mergeaggregation": "avg",
          "displayname": "basic sinus metric",
          "seriestype": "line",
          "color": "#00ff00",
          "rightaxis": false,
          "stacked": false
        },
        {
          "key": "baseCos",
          "aggregation": "avg",
          "mergeaggregation": "avg",
          "displayname": "basic cosinus metric",
          "seriestype": "line",
          "color": "#0000ff",
          "rightaxis": true,
          "stacked": false
        }
      ]
    }
  ],
  "keycharts": [
    {
      "group": "Random charts",
      "title": "random bar metric",
      "series": [
        {
          "key": "random",
          "aggregation": "avg",
          "mergeaggregation": "avg",
          "displayname": "random metric",
          "seriestype": "bar",
          "color": "#00ff00",
          "rightaxis": false,
          "stacked": false
        }
      ]
    }
  ]
},
"metrics": [
    {
      "timeseries": {
        "key": "random",
        "unit": "Count",
        "displayname": "random key metric"
      }
    },
    {
      "timeseries": {
        "key": "baseSin",
        "unit": "Count",
        "displayname": "basic sinus metric"
      }
    },
    {
      "timeseries": {
        "key": "baseCos",
        "unit": "Count",
        "displayname": "basic cosinus metric"
      }
    }
  ]
}

First, define the single chart serie. Remember to match key field with the key value defined in timeseries definition in metrics section. Next, add your series to the charts definitions. Note that you can use any series in one chart. You can also title your charts, distribute them in groups and clarify where they are found.

Charts definitions have to go into charts or keycharts arrays. Every group defined in keycharts will appear as a tab in the Entity detials view, and groups defined in charts section will be placed inside Further details tab.

Plugin Charts On Entity Details

Plugin Charts In Further Details

Different series types

You can choose between three series types: line, bar or area. All three charts below presents the same metric using different serie type.

Different Plugin Chart Series Types

Multiple series on one chart

You can use many series in one chart. You can move the axis values to the right for a particular serie by setting rightaxis field to true.

Muliple Series On One Plugin Chart

Stacked series

You can also stack series. Set the stacked field to true. The red serie in the image represents a function with highest value and the blue one with the lowest.

Stacked Plugin Charts

Aggregation

Aggregation defines the method to aggregate the minute values when working in a longer timeframe. Possible values are: sum, avg, min, max. See the differences in values of each serie when viewing charts in a 24-hour timeframe. Note that sum aggregated serie has higher value than others.

Plugin Charts Aggregation

Mergeaggregation

If your metric contains multiple dimensions, you can aggregate them into one chart. Mergeaggregation defines how to aggregate the dimension values into a single dimension. Possible values are: sum, avg, min, max. First have a look at the metric segmented by four dimensions, then see the result of mergeaggregation.

Plugin Charts With Multiple Dimensions

Plugin Chart Mergeaggregation example