Example

{% heatmap
    data="demo_daily_orders"
    x="date"
    x_date_grain="year"
    y="category"
    value="sum(total_sales)"
/%}

Attributes

data
String
required
Name of the table to query
filters
Array
default:"[]"
Array of column names to use as filters
date_range
Use date_range to filter data for specific time periods like last 12 months, year-to-date, etcExample:
date_range={
  range = value
  date = "string"
}
Attributes:
  • range: enum
  • date: string
x_date_grain
String
Time grain for date truncation (default: day for date columns)
y_date_grain
String
Time grain for date truncation (default: day for date columns)
x
String
required
Column name for x-axis categories
y
String
required
Column name for y-axis categories
value
String
required
Column name for cell values
title
String
Title to display above the chart
subtitle
String
Subtitle to display below the title
info
String
Info text to display in a tooltip next to the title. Can only be used with the title prop.
value_fmt
String
default:"num"
Format for values
x_fmt
String
Format for x axis labels
y_fmt
String
Format for y axis labels
x_sort
String
Sort order for x axis categories (asc or desc)
y_sort
String
Sort order for y axis categories (asc or desc)
value_sort
String
Sort categories by total value (asc or desc). Applies to the first axis without explicit sort.
legend
Boolean
default:"true"
Show color scale legend
borders
Boolean
default:"true"
Show borders around heatmap cells
where
String
Custom SQL WHERE condition to apply to the query. For date filters, use date_range instead.
having
String
Custom SQL HAVING condition to apply to the query after GROUP BY
limit
Number
Maximum number of rows to return from the query
order
String
Column name(s) with optional direction (e.g. “column_name”, “column_name desc”)
qualify
String
Custom SQL QUALIFY condition to filter windowed results
width
Number
Set the width of this component (in percent) relative to the page width