Skip to content

Add legend support to all charts#22

Merged
islubee merged 1 commit intomainfrom
claude/explore-repo-overview-aYE7G
Apr 19, 2026
Merged

Add legend support to all charts#22
islubee merged 1 commit intomainfrom
claude/explore-repo-overview-aYE7G

Conversation

@islubee
Copy link
Copy Markdown
Owner

@islubee islubee commented Apr 19, 2026

Summary

  • Adds a shared Legend component with color swatches that supports horizontal (top/bottom) and vertical (left/right) layouts
  • Adds showLegend and legendPosition props to all five charts: Timeline, ScatterPlot, Histogram, BarChart, and PieChart
  • Each chart wraps its content in a flex container so the legend and chart divide available space cleanly without shrinking the chart area

Test plan

  • Run npm test — all 72 tests pass (includes 8 new Legend tests)
  • Verify showLegend renders a .Legend container with correct swatches and labels
  • Verify legendPosition="top" places legend above the chart, "bottom" below, "left"/"right" beside it
  • Confirm chart fills remaining space correctly at each position (no collapsed height)
  • Check PieChart legend lists all slices with correct colors when showLabels={false}

Introduces a shared Legend component with color swatches and adds
showLegend / legendPosition props (top, bottom, left, right) to
Timeline, ScatterPlot, Histogram, BarChart, and PieChart. Each chart
wraps its content in a flex container so the legend and chart divide
the available space cleanly without shrinking the chart area. README
prop tables and CSS class reference updated; legend screenshots added.

https://claude.ai/code/session_01Bf9veNX9mqfMqrCEGnujAo
@islubee islubee merged commit 28b2ec7 into main Apr 19, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants