Skip to main content

Configuring Heatmap Panels

1. Configuring Data Format

Property Description Values Notes
dataFormat Specifies the format of the data returned by the query time_series, table, logs Default is time_series
heatmap Enables or disables heatmap visualization true, false Set to true to enable heatmap view
timeSeries Defines how time series data is structured series, matrix Used for time-based data visualization

Example: Configuring Data Format in JSON

{
  "dataFormat": "time_series",
  "heatmap": true,
  "timeSeries": "series"
}

2. Setting Y-Axis Buckets

Property Description Values Notes
yAxis.buckets Defines the number of buckets for the Y-axis in heatmap number Controls the granularity of the Y-axis buckets. Default is 10.
yAxis.calculation Defines how buckets are calculated count, sum, avg, min, max Used to aggregate data points into buckets. Default is count.
yAxis.scale Scale type for Y-axis buckets linear, log Applies to numeric buckets. Default is linear.

Example: Y-Axis Bucket Configuration

{
  "yAxis": {
    "buckets": 20,
    "calculation": "avg",
    "scale": "linear"
  }
}

3. Choosing Color Scheme

Option Values Description
colorScheme "interpolate" | "classic" | "blues" | "greens" | "reds" | "purples" | "oranges" Predefined color schemes for heatmap cells
colorScheme.custom string[] Custom color palette as hex codes (e.g., ["#000000", "#FF0000"])
colorScheme.reverse true | false Reverse the color gradient direction

Example: Using a Custom Color Palette

{
  "colorScheme": {
    "custom": ["#003f5c", "#2f4b7c", "#665191", "#a05195", "#d45087", "#f95d6a"],
    "reverse": true
  }
}
Note: The interpolate option uses a continuous gradient, while classic provides a discrete color mapping.

4. Configuring Cell Display

Property Description Values Notes
cellHeight Height of each cell in the heatmap 10 to 50 Default is 20
cellWidth Width of each cell in the heatmap 10 to 50 Default is 20
colorMode Coloring strategy for cells thresholds, opacity Default is thresholds
colorScheme Color palette used for heatmap cells Blues, Greens, Reds, Purples, Oranges Default is Blues
maxValue Maximum value for color scaling number If not set, uses max value from data
minValue Minimum value for color scaling number If not set, uses min value from data

Example: Cell Display Settings

{
  "cellHeight": 25,
  "cellWidth": 25,
  "colorMode": "thresholds",
  "colorScheme": "Reds",
  "maxValue": 100,
  "minValue": 0
}
Note: Adjusting cellHeight and cellWidth affects the overall size of the heatmap panel. Smaller cells provide more granular detail but may reduce readability.

5. Setting Legend Options

Option Values Description
legend.show true | false Controls visibility of the legend. Default is true.
legend.position right | bottom Determines where the legend is displayed. Default is right.
legend.calcs Array of calculation types Specifies which calculations to display in the legend. Options include mean, min, max, count.

Example: Configuring Legend Options

{
  "legend": {
    "show": true,
    "position": "right",
    "calcs": ["mean", "min"]
  }
}

6. Configuring Tooltip

Property Description Values Notes
tooltip.mode Controls how tooltips are displayed single, multi, none Default: single
tooltip.showItems Whether to show the items in the tooltip true, false Default: true
tooltip.sort Sort order of items in tooltip none, asc, desc Default: none

Example: Tooltip Configuration

{
  "tooltip": {
    "mode": "multi",
    "showItems": true,
    "sort": "desc"
  }
}

7. Setting Bucket Bound

Property Description Values Notes
bucketBound Defines the boundaries for heatmap buckets auto, custom Use auto for automatic bucketing, custom to define specific boundaries

Example: Custom Bucket Bound

{
  "bucketBound": "custom",
  "bucketBounds": [0, 10, 20, 30, 40, 50]
}

8. Using Exemplars

Exemplars in Grafana provide a way to associate time series data with specific trace or log events, enabling deeper context and debugging capabilities. They are particularly useful in heatmap panels to visualize how data points relate to specific trace events.

Property Description Values
exemplar Enables or disables exemplar support for the panel true / false
exemplarColor Color used to display exemplar markers on the heatmap #FF0000 (hex color)

Example: Enabling Exemplars in Heatmap Panel

{
  "panels": [
    {
      "id": 1,
      "type": "heatmap",
      "title": "Request Duration Heatmap",
      "exemplar": true,
      "exemplarColor": "#FF0000"
    }
  ]
}
Note: Exemplars require a compatible data source that supports trace or log data, such as Loki or Jaeger.

9. Configuring Hide Zero Values

Option Values Description
hideZero true | false When set to true, zero values in the heatmap will be hidden from display. Defaults to false.

Example: Hide Zero Values in Heatmap

{
  "hideZero": true
}

10. Setting Y-Axis Decimals

Property Description Values Notes
yAxis.decimals Number of decimal places to display on the Y-axis 0, 1, 2, etc. Set to 0 to show whole numbers only. Default is auto-calculated.

Example: Y-Axis Decimal Configuration

{
  "yAxis": {
    "decimals": 2
  }
}

Was this article helpful?