Langsung ke konten
Skillpedia
Analisis & spreadsheet41k Β· #6900

choosing-trend-or-slope-view

Fungsinya

Skill ini membantu Anda memilih grafik yang tepat saat seseorang bertanya seberapa banyak sesuatu berubah di antara dua titik. Ditujukan untuk siapa saja yang menginginkan grafik yang sesuai dengan pertanyaannya.

Kapan dipakai

  • βœ“Saat Anda bertanya seberapa banyak sesuatu bertambah atau berkurang di antara dua tanggal.
  • βœ“Saat Anda ingin melihat bagaimana metrik bergerak sepanjang periode, termasuk lonjakan.
  • βœ“Saat Anda ingin membandingkan banyak seri berdasarkan nilai awal dan akhirnya.

Link skill

https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/choosing-trend-or-slope-view/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/choosing-trend-or-slope-view/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œSeberapa banyak pendaftaran berubah dari Januari ke Maret?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Jika permintaan dapat berarti jalur penuh atau hanya awal dan akhir, skill terlebih dahulu mengajukan pertanyaan singkat. Kedua grafik berasal dari kueri tren yang sama pada rentang tanggal yang sama, dan grafik lereng hanya menyimpan titik pertama dan terakhir.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Choosing a trend line vs a slope view

"How did X change between A and B?" is ambiguous. Two charts answer two different questions, so clarify before you build unless the user already named one:

  • Change over time (line) β€” the value at every interval across the range. Shows the path: dips, spikes, when it moved. This is the default trend.
  • Start vs end (slope) β€” only the first and last point, one line per series connecting them. Shows the net change and, across many series, which rose, which fell, and any rank flips β€” without the noise of the path between.

When the request could be either, ask a short either/or, e.g.:

Do you want to see how it moved across the whole period (a line chart), or just the change from the start to the end (a slope chart)?

If the user clearly wants one β€” "just tell me how much it grew start to end" β†’ slope; "show me the trend / when did it spike" β†’ line β€” skip the question and build it.

How to render each

Both come from the same TrendsQuery over the same date range β€” the slope is that series collapsed to its first and last point, not a different query.

Change over time β†’ line

Default trends behavior. Create or run a TrendsQuery and leave trendsFilter.display as ActionsLineGraph (the default, "change over time"):

{
  "kind": "TrendsQuery",
  "series": [{ "kind": "EventsNode", "event": "$pageview", "math": "total" }],
  "dateRange": { "date_from": "2025-01-01", "date_to": "2025-03-31" },
  "trendsFilter": { "display": "ActionsLineGraph" }
}

Start vs end β†’ slope

Run the trend with posthog:query-trends. The result card Max renders has a Line / Bar / Slope view toggle β€” switch it to Slope to show each series as a single line from its first to its last point, with the per-series change in the legend. Tell the user they can flip to the Slope view on the result.

The slope view is best for a clean before→after comparison, especially with several series/categories whose relative movement matters. Pick a date range whose two ends are the points you want compared (the slope uses the first and last interval).

Important limits

  • Two surfaces, one computation. Both the inline slope (Max's query-trends result card) and the saved-insight slope (ChartDisplayType.SlopeGraph) show the same thing: the first interval's value vs the last interval's value, at the chosen group-by interval. The grouping defines the slope - group by month to compare the first vs last month, by day for the first vs last day. Use the inline view for a quick before-and-after on a result you're already looking at; use the saved display to persist it on a dashboard. A still-accumulating final period is shown as-is with a dashed connector, the same affordance the line chart uses for an incomplete tail.
  • For period-over-period on a single series (this month vs last), a line with compareFilter: { "compare": true } overlays the two periods; a slope is the better fit when comparing the endpoints of many series at once.
Pertanyaan umum

Apakah kedua grafik didasarkan pada data yang berbeda?

Tidak. Keduanya berasal dari kueri tren yang sama pada rentang tanggal yang sama, dan grafik lereng hanya menyimpan titik pertama dan terakhir.

Bagaimana jika saya sudah tahu grafik mana yang saya inginkan?

Jika Anda dengan jelas meminta salah satunya, skill membuatnya tanpa bertanya.

Kapan grafik lereng lebih baik?

Grafik lereng lebih baik untuk menunjukkan perubahan bersih dan perubahan peringkat di banyak seri, tanpa gangguan di antaranya.

Detail

Deskripsi asli dari pembuat

Clarify how to visualize change over a time range before building a trend. Use whenever the user asks how much something changed, grew, dropped, improved, or regressed between two points or periods β€” "how much did X change from A to B", "before vs after", "start vs end", "week over week", "compare this month to last", "change over time" β€” or mentions a "slope chart" / "slopegraph". Two readings of "change" need different charts: the whole trend (a line, every interval) versus just the two endpoints (a slope, start vs end). Ask which they want, then render it. Not for choosing a saved insight C

repo: PostHog/posthog

Popularitas

Bintang GitHub
41k
Peringkat
#6900
Lisensi
β€”
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa