Skip to content

Histogram

A histogram chart displays the distribution of a numeric field by grouping values into bins (buckets) and showing the count of values in each bin as vertical bars.

The following example demonstrates a basic histogram visualization.

Start with a query that counts values grouped by a numeric field:

source = opensearch_dashboards_sample_data_flights | stats count() by AvgTicketPrice

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

  • The X-Axis displays the AvgTicketPrice field.

The result is a histogram showing the distribution of ticket prices, as shown in the following image.

Histogram chart showing distribution of average ticket prices

You can configure the following settings in the configuration panel.

In the Fields section, configure the fields displayed on each axis.

FieldDescription
X-AxisSelect a numeric field to distribute into buckets along the horizontal axis.
Y-AxisSelect a numeric field for the vertical axis. If left blank, the chart displays the count of values in each bucket.

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

The following settings control how data is grouped into bins.

SettingDescription
Bucket SizeSets the width of each bin. Enter a numeric value or leave as auto to let the editor calculate an appropriate size.
Bucket countSets the maximum number of bins to display.

For information about configuring thresholds, see Thresholds.

The X-axis and Y-axis share the same configuration options. For more information, see Axes.

Use the following settings to customize the appearance of the histogram.

SettingDescription
Use threshold colorsWhen enabled, colors bars based on threshold ranges.
Show borderWhen enabled, adds a border around each bar.

Toggle the Show tooltip selector to enable or disable tooltips.