Aller au contenu
Skillpedia
Analyse et tableurs41k · #6900

choosing-trend-or-slope-view

Ce qu’il fait

Cette skill vous aide à choisir le bon graphique lorsqu'on demande comment quelque chose a évolué entre deux moments. Elle s'adresse à toute personne qui veut un graphique adapté à sa question.

Quand l’utiliser

  • ✓Quand vous demandez de combien quelque chose a augmenté ou baissé entre deux dates.
  • ✓Quand vous voulez voir comment une métrique a évolué sur toute la période, y compris les pics.
  • ✓Quand vous voulez comparer plusieurs séries par leurs valeurs de début et de fin.

Lien du skill

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

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/choosing-trend-or-slope-view/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“De combien les inscriptions ont-elles changé entre janvier et mars ?”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

Si la demande peut signifier soit le parcours complet, soit seulement le début et la fin, la skill pose d'abord une courte question. Les deux graphiques proviennent de la même requête sur la même période, et un graphique de pente ne garde que le premier et le dernier point.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis 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.
Questions fréquentes

Les deux graphiques reposent-ils sur des données différentes ?

Non. Les deux viennent de la même requête de tendances sur la même période, et le graphique de pente ne garde que le premier et le dernier point.

Et si je sais déjà quel graphique je veux ?

Si vous demandez clairement l'un des deux, la skill le construit sans poser de question.

Quand un graphique de pente est-il préférable ?

Il est préférable pour montrer la variation nette et les changements de rang sur de nombreuses séries, sans le bruit des valeurs intermédiaires.

Détails

Description originale de l’auteur

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

Popularité

Étoiles GitHub
41k
Position au classement
#6900
Licence
—
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires