Line Chart
Trends and time series visualization guidance.
When to Use
Time-based trends, cumulative progression (with derived series), comparisons (YoY, moving average).
Data Shape
time, value (optional: series)
Prompt Patterns
- Daily active users last 30 days line chart include 7-day moving average.
- Weekly sum of revenue last 26 weeks line chart compare previous 26 weeks.
- Monthly churn_rate last 12 months line chart with previous year comparison.
Example Prompts
- Daily sum of orders last 90 days line chart include previous 7-day moving average.
- Weekly sum of revenue and cost last 26 weeks line chart add profit = revenue - cost.
- Monthly distinct active_users last 12 months line chart include previous year same month values.
Best Practices
- Pick sensible granularity (daily for < 120 days, weekly for longer).
- Limit series (≤5) to avoid clutter.
- Add moving average for noisy metrics.
- Normalize secondary metric if scales differ (or split charts).
Common Mistakes
- Using line for unordered categories.
- Mixing incompatible granularities (daily + monthly).
- Too many series (hard to read).
Derived & Reference Lines
Specify formula and reference: Include 30-day moving average, Include target line = 5000.
Troubleshooting
Jagged line? Aggregate to weekly. Flat line? Check aggregation or filter removing variance.
Snippet Progression
- Daily orders last 14 days line chart.
- Daily orders last 14 days line chart include 7-day moving average.
- Daily orders last 14 days line chart include 7-day moving average and same day previous week comparison.