formatting-insight-axes
Originally fromposthog/skills
Installation
SKILL.md
Formatting insight axes
PostHog renders insights with a built-in axis formatter. Use it instead of contorting the query or a literal prefix/postfix to fake units.
The two insight kinds configure it in different places:
- TrendsQuery —
trendsFilter.aggregationAxisFormat(this page, below) - SQL insights (
DataVisualizationNode) — per-columnsettings.formatting(see SQL insights)
The anti-pattern
If you are reaching for any of these, stop and pick a format below first:
formula: "A / 60"withaggregationAxisPostfix: " mins"— manual seconds -> minutesformula: "A / 1000"withaggregationAxisPostfix: " s"— manual ms -> secondsformula: "A * 100"withaggregationAxisPostfix: "%"— manual ratio -> percentaggregationAxisPostfix: "ms"/"s"/"min"/"hr"on raw values