
Visualizing Change Over Time
FreeChoose the right chart for time-based data visualization.
Free · Opens the source repo
What Visualizing Change Over Time does
Visualizing change over time is crucial for understanding trends and making informed decisions based on data. This skill is designed specifically for PostHog engineers and agents, providing guidance on selecting the most appropriate chart type when dealing with requests about how something has changed over time. It supports various scenarios, including before/after comparisons and period-over-period analysis, ensuring that users can effectively visualize their data using the @posthog/quill-charts library.
When users inquire about changes, such as growth, decline, or fluctuations between two points, this skill offers a structured approach to selecting the right visualization. For continuous data across multiple time points, a line or area chart is typically recommended. However, for cases involving only two points, particularly across several categories, the skill suggests using a slope graph. This allows users to quickly assess the direction and magnitude of changes, making it easier to identify trends and shifts in their data.
The skill also provides options for other types of visualizations, such as bar charts for discrete comparisons and metric cards for highlighting key figures alongside their changes. By surfacing these options, the skill empowers users to make informed choices about how to present their data, enhancing the clarity and impact of their visualizations. This is particularly useful in the context of dashboards, reports, and custom visualizations where effective communication of insights is essential.
Overall, this skill is an invaluable resource for anyone working with time-based data in PostHog, streamlining the process of selecting the right visualization and improving the overall user experience in data analysis and reporting.
When to use it
Use this skill when you need to visualize time-based data, particularly for before/after comparisons or period-over-period analysis.
When not to use it
This skill may not be suitable for visualizing non-time-related data or when complex statistical analysis is required.
What you can build with it
Comparing Two Time Periods
Use the skill to visualize changes between two specific time periods, such as this week versus last week, using a slope graph for clarity.
Displaying Trends Over Time
For continuous data across many time points, leverage the skill to select a line or area chart that effectively shows trends.
Highlighting Key Metrics
Utilize the metric card option to showcase a primary metric and its change, providing a quick snapshot of performance.
How to install Visualizing Change Over Time
View source1. Install with the skills CLI
npx skills add posthog/posthog/visualizing-change-over-time --agent claude-code2. 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 posthogVisualizing change over time
When a request is about how something changed, the default reach is a line/area
trend — and that is usually right for a continuous series with many x points. But for
some change-over-time shapes a different chart reads far better. This skill is the
menu to offer, including the slope graph, when building visualizations with
@posthog/quill-charts.
Present the fitting option(s) and let the user choose — none of these is mandatory.
Pick by the shape of the change
| The change is… | Reach for | Why |
|---|---|---|
| A continuous series over many time points (a trend) | TimeSeriesLineChart / LineChart (area fill for emphasis) | The standard trend; the slope between every pair of points is visible. |
| Two points only (before → after) across several series/categories | SlopeChart | One line per entity from a left "before" to a right "after" — direction and magnitude of each entity's change, and rank flips, read at a glance. |
| Magnitude comparison at points in time (not the path between them) | BarChart / TimeSeriesBarChart | Bars compare discrete values; group/stack for sub-series. |
| A single headline number plus its change vs a prior period | MetricCard | Big number + sparkline + change pill. |
If the user is comparing exactly two snapshots (this week vs last, control vs treatment, Q1 vs Q2) and especially when there are many categories whose relative movement matters, offer the slope graph as the cleaner alternative to a grouped bar or a 2-point line chart.
Using the SlopeChart
import { SlopeChart } from '@posthog/quill-charts'
import type { Series } from '@posthog/quill-charts'
import type { SlopeSeriesMeta } from '@posthog/quill-charts'
// One series per entity; `data` is exactly [start, end].
const series: Series<SlopeSeriesMeta>[] = [
{ key: 'us', label: 'US', data: [120, 185] },
{ key: 'eu', label: 'EU', data: [200, 150] },
]
<SlopeChart
series={series}
labels={['Before', 'After']}
theme={theme}
config={{
showSeriesLabels: true, // name beside each end point; steepest line always keeps its label
legend: { show: true }, // each row shows the color, label, and the formatted change
deltaFormatter: (d) => `${d >= 0 ? '+' : ''}${d}`,
}}
/>
Key options (full list in the charts AGENTS.md "Composition" section):
showStartLabels/showEndLabels— chart-level defaults for the value labels; override per series withmeta.showStartLabel/meta.showEndLabel.showSeriesLabels— the name labels; on collision the series with the largest change (|end − start|) always keeps its label.legend: { show, position }— rows carry the per-series change (deltaFormatter).- The value axis is hidden by default — the start/end labels are the readout.
The theme comes from useChartTheme(); give the wrapper a real height. See the
charts AGENTS.md for theme wiring and sizing.
Scope note
There are two ways to render a slope graph; which you reach for depends on the surface:
SlopeChart— the@posthog/quill-chartscomponent. Use it when building UI directly: dashboards, reports, themcp_analyticsfrontend, custom visualizations. It backs the Slope view toggle on Max's inline trends result card (services/mcp/src/ui-apps/components/TrendsVisualizer.tsx).ChartDisplayType.SlopeGraph— a first-class insight display (value'SlopeGraph'infrontend/src/types.ts), rendered by the backendSlopeGraphTrendsQueryRunner(posthog/hogql_queries/insights/trends/slope_graph_trends_query_runner.py). It takes aTrendsQueryand keeps the first and last bucket of the date range as the two slope points (the last segment is dashed when it's the current, still-accumulating period). Set it viatrendsFilter.display: "SlopeGraph"(trends-only).- In the product insight editor, the picker entry is gated behind
FEATURE_FLAGS.SLOPE_GRAPH_INSIGHT(slope-graph-insight). - Via the API /
posthog:insight-createMCP tool it works without the flag — pass aTrendsQuerywithtrendsFilter.display: "SlopeGraph". To frame a clean before → after, choose the date range andintervalso the first bucket is your baseline and the last is "now" (e.g. monthly buckets starting from the baseline month).
- In the product insight editor, the picker entry is gated behind
Frequently asked questions about Visualizing Change Over Time
Similar skills
D3.js Visualisation
Create interactive and custom data visualisations with D3.js.
LeRobot Visualizer
Easily visualize and inspect LeRobot datasets in your browser.
Social Media Dashboard
Create a streamlined analytics dashboard for social media.
Seaborn Statistical Visualization
Create attractive statistical graphics with minimal code.
Scientific Visualization
Create publication-ready scientific figures with integrity.
Matplotlib
Create highly customizable plots for scientific visualization.
