New to Claude Skills? Learn how to install them →

posthog on GitHub

Choosing Trend or Slope View

Free

Clarify visualizations of change over time.

by posthog37.6k stars on posthog/posthog
1 views
Updated Aug 11, 2026
Get this skill

Free · Opens the source repo

What Choosing Trend or Slope View does

The Choosing Trend or Slope View skill is designed to help users visualize changes in data over specified time ranges effectively. It addresses the ambiguity in how to represent changes by distinguishing between two types of visualizations: trend lines and slope charts. Users often inquire about how much something has changed, improved, or regressed, and this skill provides the necessary guidance to select the appropriate chart type based on their specific question.

When a user asks about changes over time, the skill prompts them to clarify whether they want to see the entire trend (a line chart) or just the net change from the start to the end (a slope chart). This distinction is crucial, as each chart serves a different purpose. The line chart displays the entire path of the data over time, showcasing fluctuations and trends, while the slope chart focuses on the beginning and end points, making it easier to compare multiple series without the distractions of intermediate data points.

The skill operates by utilizing the same underlying data query for both chart types, ensuring that users can seamlessly switch between visualizations based on their needs. It is particularly useful in scenarios where users are analyzing multiple series or categories, as the slope chart provides a clear overview of relative movements and ranks. This capability is essential for data analysts and business intelligence professionals who need to present data insights clearly and effectively.

While this skill is powerful for visualizing changes, it is not intended for selecting saved insights in the insight editor, which may require different functionalities. Instead, it focuses on helping users understand the best way to visualize their data based on their specific questions about change over time.

When to use it

Use this skill when you need to visualize how data has changed over a time range and want to determine the best way to represent that change.

When not to use it

Avoid using this skill for selecting pre-existing saved insights or when you need a more complex analysis beyond simple trend comparisons.

What you can build with it

Comparing Monthly Sales

Use this skill to determine whether to visualize sales data as a trend line for detailed analysis or as a slope chart for a quick overview of monthly changes.

Analyzing User Engagement

When assessing user engagement over a specific period, clarify whether to show the detailed trend or just the start and end points for a concise comparison.

Visualizing Performance Metrics

For performance metrics that fluctuate, decide if a trend line is needed for full context or if a slope chart suffices for a straightforward before-and-after analysis.

How to install Choosing Trend or Slope View

View source

1. Install with the skills CLI

npx skills add posthog/posthog/choosing-trend-or-slope-view --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by posthog

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, behind the slope-graph-insight feature flag) 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→after on a result you're already looking at; reach for the saved display to persist it on a dashboard where the flag is enabled. 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.

Frequently asked questions about Choosing Trend or Slope View

Similar skills