It is possible to add forecasting data points to one or multiple series on a chart. This is basically a 3-period moving average based on the last there data points available on the series and has been designed mainly for demo purposes (at least for the time being).

Enabling Forecasting

To add forecast data points to a chart:

  1. Add forecast object to the chart configuration object

  2. The aforementioned object must have at least the periods key with an integer as its value, which is the number of forecast data points added to the original series.

  3. In the metrics array, add the plotForecast key to the metric(s) you’d like to forecast and set its value to true.

Example

In the example below, three forecast data points are being added to the gross_sales metric data.

	"example_chart":{
		title:"Sales",
		tab: "accounting",
		type: "bar",
		forecast: {
			periods: 3,
			opacity: 0.5,
			strokeWidth: "small",
			strokeDash: "small"
		},
		metrics: [
			{
				key:"gross_sales",
				plotForecast: true,
			},
			{
				key:"net_sales",
			}
		],
	},
JSON

Forecast Parameters

Attribute

Required

Type

Description

periods

✔

integer

Number of forecast data points added to the metric series

opacity

float

Sets the opacity of the forecast line/bar

min: 0

max :1

strokeWidth

string

The width of the metric series (how thick or thin a line is, for example).

Possible values:
none, small, medium or large

strokeDash

string

The values determine the amount of space between the dashes in the series.

Possible values:
none, small, medium or large