Loading...
Loading...
Pick the right y-axis unit when creating or updating an insight via `posthog:insight-create` or `posthog:insight-update` — both TrendsQuery (`trendsFilter.aggregationAxisFormat`) and SQL insights (`DataVisualizationNode`, `chartSettings.yAxis[].settings.formatting`). Use when the agent is about to add a `formula` purely to convert units (e.g. dividing seconds by 60 to display minutes), when a `math_property` or SQL column is a duration, currency, ratio, or large count, or whenever the user mentions "format the y-axis", "duration", "seconds", "minutes", "hours", "milliseconds", "ms", "percentage", "%%", "currency", "decimals", "axis label", or "axis unit" in the context of a graph insight.
npx skill4agent add posthog/skills formatting-insight-axestrendsFilter.aggregationAxisFormatDataVisualizationNodesettings.formattingformula: "A / 60"aggregationAxisPostfix: " mins"formula: "A / 1000"aggregationAxisPostfix: " s"formula: "A * 100"aggregationAxisPostfix: "%"aggregationAxisPostfix: "ms""s""min""hr"trendsFilter.aggregationAxisFormat| Value | Use when the series is... | Renders as |
|---|---|---|
| a plain count | |
| seconds (any scale) | |
| milliseconds | |
| already 0-100 | |
| a ratio 0-1 | |
| money in the project's base currency | |
| large counts you want compacted | |
trendsFilteraggregationAxisPrefix"$"aggregationAxisPostfix" req"" events""mins""s""%"%"%"50%%decimalPlacesformatprefixaggregationAxisFormat: "currency"$ai_total_cost_usdaggregationAxisPrefix: "$"decimalPlaces: 2format: "currency"€aggregationAxisFormat: "duration""I can pin the y-axis to minutes by dividing the series by 60, or use PostHog'sformatter which auto-picks seconds / minutes / hours per value —durationrenders as90sand1m 30sas5400s. Which would you prefer?"1h 30m
duration{
"kind": "TrendsQuery",
"series": [
{
"kind": "EventsNode",
"event": "$pageview",
"math": "p95",
"math_property": "$performance_page_loaded"
}
],
"trendsFilter": {
"aggregationAxisFormat": "duration_ms"
}
}{
"kind": "TrendsQuery",
"series": [
{
"kind": "EventsNode",
"event": "$pageleave",
"math": "avg",
"math_property": "$session_duration"
}
],
"trendsFilter": {
"aggregationAxisFormat": "duration"
}
}{
"trendsFilter": {
"aggregationAxisFormat": "currency",
"decimalPlaces": 2
}
}{
"trendsFilter": {
"aggregationAxisPrefix": "$",
"decimalPlaces": 2
}
}{
"kind": "TrendsQuery",
"series": [
{
"kind": "EventsNode",
"event": "checkout_completed",
"math": "dau"
},
{
"kind": "EventsNode",
"event": "checkout_started",
"math": "dau"
}
],
"trendsFilter": {
"formula": "A / B",
"aggregationAxisFormat": "percentage_scaled",
"decimalPlaces": 1
}
}trendsFilterchartSettings.yAxis[].settings.formattingtableSettings.columns[].settings.formatting{
"kind": "DataVisualizationNode",
"source": { "kind": "HogQLQuery", "query": "SELECT week, conversion_rate FROM ..." },
"display": "ActionsLineGraph",
"chartSettings": {
"xAxis": { "column": "week" },
"yAxis": [
{
"column": "conversion_rate",
"settings": { "formatting": { "style": "percent", "decimalPlaces": 1 } }
}
]
}
}stylenonenumbershortpercentdurationcurrencyprefixsuffixpercent%percentage_scaledsuffix| SQL returns | | Renders |
|---|---|---|
a 0-1 ratio ( | | |
0-100 ( | | |
style: "percent""%"47.3%%percent4730%100.0 *formulapostfixstyle: "percent""%"posthog:insight-update100.0 *%