# Activity Graph
Render a GitHub-style activity heatmap from Dataview queries. Use Dataview queries directly with optional query level setting overrides.
## Requirements
- Obsidian
- Dataview plugin enabled
## Basic usage
Use an `activity-graph` code block containing a Dataview query:
```activity-graph
TABLE file.day AS date, 1 AS value
FROM "Daily"
SORT file.day ASC
```
## Query requirements
Your Dataview query must return:
- `date`: a date value (Dataview date, `file.day`, or an ISO date string like `YYYY-MM-DD`)
- `value`: a number (for intensity; use `1` for binary activity)
## Examples
Count files (binary activity):
```activity-graph
TABLE date(file.name) AS date, 1 AS value
FROM "Exercise Logs"
```
Track a numeric field:
```activity-graph
TABLE file.day AS date, duration AS value
FROM "Exercise Logs"
```
## Per-query overrides
Add a `---` block after the query:
```activity-graph
TABLE file.day AS date, duration AS value
FROM "Exercise Logs"
---
title: Exercise
daysToShow: 90
showLegend: false
colorGradient: purple
minValue: 0
maxValue: 3
lessLabel: 0
moreLabel: 3+
```
Supported overrides:
- title
- daysToShow
- showMonthLabels
- showWeekdayLabels
- showLegend
- startWeekOnMonday
- colorGradient
- lessLabel
- moreLabel
- minValue
- maxValue
## Notes
- The graph ends on today's date (local time) and shows `daysToShow` days backwards.
- Overrides are plain `key: value` lines following a `---`.
- Supported gradients: `green`, `blue`, `purple`, `orange`, `red`, plus any custom palettes you add in settings (default: `green`).
- `minValue`/`maxValue` let you lock the heatmap scale; leave blank in settings (or omit in overrides) to keep it relative.
- The following css snippet can be added to allow more space for the graph, can look squished otherwise:
```
body {
--file-line-width: 1000px;
}
```
## Upcoming Features
- Custom date range (currently only supports today - X days)
- If you have a desired feature, let me know!
## Screenshots
### Query
### Result
### Default Color Pallets
#### Green
#### Blue
#### Purple
#### Orange
#### Red