본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트41k · #6903

formatting-insight-axes

하는 일

이 스킬은 PostHog 인사이트의 축 형식을 설정해서 숫자가 초, 분, 퍼센트 같은 명확한 단위로 보이게 합니다. 시간이나 비율 값으로 차트를 만드는 분석가를 위한 것입니다.

사용하는 경우

  • ✓값을 분이나 퍼센트로 보이게 하려고 나눗셈을 따로 해야 할 때.
  • ✓차트 축에 시간 값을 보기 쉬운 단위로 보여 주고 싶을 때.
  • ✓SQL 인사이트 열에 숫자를 바꾸지 않고 단위를 표시하고 싶을 때.

스킬 링크

https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/formatting-insight-axes/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/formatting-insight-axes/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“차트에 평균 응답 시간을 숫자는 그대로 두고 분 단위로 보여 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

단위 변환 계산 대신 내장 축 형식을 설정합니다. 그러면 형식 지정기가 각 값에 맞는 읽기 쉬운 단위를 고르고, 기초 숫자는 정확하게 유지됩니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

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-column settings.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" with aggregationAxisPostfix: " mins" — manual seconds -> minutes
  • formula: "A / 1000" with aggregationAxisPostfix: " s" — manual ms -> seconds
  • formula: "A * 100" with aggregationAxisPostfix: "%" — manual ratio -> percent
  • aggregationAxisPostfix: "ms" / "s" / "min" / "hr" on raw values

These freeze the unit at one scale. The built-in formatter picks a friendly unit per value (1.5s, 2m 12s, 1h 4m) and keeps the underlying series numerically correct for further math, breakdowns, and alerts.

Available formats

Set trendsFilter.aggregationAxisFormat on the TrendsQuery:

Value Use when the series is... Renders as
numeric (default) a plain count 1,234
duration seconds (any scale) 45s, 2m 12s, 1h 4m
duration_ms milliseconds 850ms, 1.5s, 1m 4s
percentage already 0-100 47.3%
percentage_scaled a ratio 0-1 47.3%
currency money in the project's base currency $1,234.56 (or local code)
short large counts you want compacted 1.2K, 3.4M

Companion fields on trendsFilter:

  • aggregationAxisPrefix — literal prefix (e.g. "$") when you need a symbol pinned to a specific currency or unit, regardless of project settings
  • aggregationAxisPostfix — literal suffix; reserve for genuine units the format can't express (e.g. " req", " events"), never for "mins" / "s" / "%" — the percentage formats already append the % sign, so a "%" postfix renders 50%%
  • decimalPlaces — cap decimals (1 or 2 is usually right for currency / ratios)

Currency — pick format or prefix carefully

aggregationAxisFormat: "currency" renders with the project's base currency (set in project settings, defaults to USD). Use it when the underlying values are in that same currency — e.g. revenue events that PostHog auto-converts to the project's base currency.

If the values are pinned to a specific currency regardless of project (e.g. $ai_total_cost_usd is always USD, even on a EUR-base project), use aggregationAxisPrefix: "$" + decimalPlaces: 2 so the symbol matches the data. Using format: "currency" here would render USD values with € on a EUR project.

When the series is in seconds

If the series is in seconds (latency, session length, time-to-first-event, processing time, page load, etc.), silently default to aggregationAxisFormat: "duration". Do not stop to ask — the formatter is non-destructive (the underlying values stay in seconds either way, only the labels change), so picking it is always at least as good as raw seconds.

Only confirm with the user when they have explicitly named a fixed unit they want pinned ("show this in minutes", "graph the average in hours"):

"I can pin the y-axis to minutes by dividing the series by 60, or use PostHog's duration formatter which auto-picks seconds / minutes / hours per value — 90s renders as 1m 30s and 5400s as 1h 30m. Which would you prefer?"

In one-shot MCP contexts where no user is in the loop, just pick duration and move on.

Examples

Latency — duration in milliseconds

{
  "kind": "TrendsQuery",
  "series": [
    {
      "kind": "EventsNode",
      "event": "$pageview",
      "math": "p95",
      "math_property": "$performance_page_loaded"
    }
  ],
  "trendsFilter": {
    "aggregationAxisFormat": "duration_ms"
  }
}

Average session length — duration in seconds

{
  "kind": "TrendsQuery",
  "series": [
    {
      "kind": "E
자주 묻는 질문

단위 변환 수식을 쓰면 안 되나요?

고정된 변환은 한 가지 단위로 묶이지만, 내장 형식은 각 값에 맞게 조정되고 다른 계산에도 데이터가 계속 쓸 수 있게 합니다.

SQL 인사이트에도 작동하나요?

네. SQL 인사이트는 차트 설정에서 열마다 형식을 지정합니다.

숫자가 바뀌나요?

아니요. 표시만 바뀌므로 값은 수치적으로 정확하게 유지됩니다.

상세 정보

작성자의 원본 설명

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", "percentag

repo: PostHog/posthog

인기도

GitHub 스타
41k
순위
#6903
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬