Skip to content

Metric chart

A metric chart displays a single numeric value prominently, making it ideal for showing key performance indicators (KPIs) or summary statistics at a glance.

The following example demonstrates a basic metric visualization.

Start with a query that returns a numeric field:

source = opensearch_dashboards_sample_data_flights | FIELDS AvgTicketPrice

After running this query, select Metric as the chart type. The editor maps the field as follows:

  • The Value field displays the AvgTicketPrice field (using the Last calculation by default).

The result is a single large number displaying the last ticket price value, as shown in the following image.

Metric chart displaying the last average ticket price

You can configure the following settings in the configuration panel.

In the Fields section, configure the data fields.

FieldDescription
ValueSelect a numeric field to display as the metric value. The field is reduced to a single number using the configured calculation method.

In the Split by dropdown list, select a field to split the chart into separate elements by value. For more information, see Split.

SettingDescription
Text displayControls what text is shown alongside the value. Supported values: Value only, Name only, Value and Name, None.
Color modeControls how threshold colors are applied to the metric. Supported values: None (no color), Value (colors the value text), Background gradient (applies a gradient background), Background solid (applies a solid background color).
Show percentageWhen enabled, displays the value as a percentage of the max value.
Use threshold colorsWhen enabled, applies threshold colors to the metric based on the current value.
SettingDescription
CalculationDetermines how multiple data points are reduced to a single value. Supported values: Last *, Last, First *, First, Min, Max, Median, Variance, Distinct count, Count, Total. For more information, see Value calculations.

For information about configuring thresholds, see Thresholds.

SettingDescription
MinThe lower bound of the metric scale (used for percentage calculations).
MaxThe upper bound of the metric scale (used for percentage calculations).
UnitsAn optional unit label applied to the displayed value.
SettingDescription
Value sizeControls the font size of the displayed value.
Title sizeControls the font size of the metric title.
Percentage sizeControls the font size of the percentage display (when Show percentage is enabled).