DocumentationNuxt Charts v3

Contribution Graph

A GitHub-style calendar heatmap for visualizing daily activity over a year.

The ContributionGraph component plots a value per day across a year as a calendar heatmap — the familiar GitHub "contributions" grid. Use it for commit activity, usage density, streaks, publishing cadence or any per-day metric where the pattern over time matters more than exact values.

Example

Each column is a week, each cell a day; color intensity scales with the day's count. Hover a cell for its value.

Learn how to use the Nuxt Charts CLI to get premium components.

Data

Pass a sparse array of { date, count } objects. Dates use the YYYY-MM-DD format and only active days need an entry — any day without one is rendered as the empty (level 0) state. The grid starts on the Sunday of the earliest date's week so every column is a full seven-day week.

Props

PropTypeDefaultDescription
data{ date: string, count: number }[]RequiredSparse list of day → count. Missing days are treated as 0.
levelsnumber4Number of intensity buckets (excluding the empty state).
colorstringvar(--ui-primary)Base color for the highest intensity; lower levels fade from it.
cellSizenumber12Size of each day cell in pixels.
cellGapnumber3Gap between cells in pixels.
cellRadiusnumber2Corner radius of each cell in pixels.
showWeekdayLabelsbooleantrueShow the Mon / Wed / Fri labels column.
showMonthLabelsbooleantrueShow the month labels row.
showLegendbooleantrueShow the Less → More legend.
maxCountnumberdata maxExplicit upper bound for the color scale.
tooltipFormatter(day) => stringCustom tooltip text for a day.