Skip to Content

Chart types

Set up a histogram

Show how values spread across buckets that your query returns.

Show how many values fall in each bucket. Databrain does not make the buckets. Your query returns them.

What the data needs

DimensionsMeasures
1 that holds the buckets, for example 0-10, 10-20Exactly 1, for example a count

Steps

  1. Write the buckets in your query. For example:

    SELECT FLOOR(order_value / 100) * 100 AS bucket, COUNT(*) AS orders
    FROM orders
    GROUP BY 1
    ORDER BY 1
  2. Add bucket to Dimensions and orders to Measures.

  3. In the chart toolbar, select Chart type, then Histogram.

    Chart type picker in the metric builder with the Histogram tile highlighted
    Histogram in the Chart type picker.
  4. To change how it looks, select Appearance.

    Chart settings for a histogram with the Chart colors section highlighted
    Chart colors sets the palette and gradients.

The chart shows one bar for each bucket.

Settings for this chart

  • Chart colors has Random colors for bars and Bar background gradient.
  • Features has Bar background, Limit data points and Chart zoom.

To write a query, see create a metric with SQL.