tech-hy/skills/recharts-stacked-interactivity
Claude Code and agent skill by tech-hy/skills
- community
Checking that the SKILL.md file is still in the repository.
Build or debug React/Recharts stacked area and pie or donut dashboards with custom hover states, legend-driven highlight and toggle behavior, tooltip ordering that matches stacked layers, synchronized chart interactions, and mobile-safe chart layouts. Use when Codex is implementing or fixing analytical dashboards in React with Recharts and the default Legend or Tooltip behavior is not enough.
Install
npx vskill@latest install tech-hy/skills/recharts-stacked-interactivitySKILL.md
The same SKILL.md was published earlier as tech-hy/skills/recharts-stacked-interactivity.
Recharts Stacked Interactivity
Implement interactive stacked charts with shared bucket metadata, custom HTML legends, and deterministic tooltip rendering. Prefer this skill when the chart needs hover highlight, click-to-hide series, synchronized brushes, or pie and donut hover behavior that Recharts defaults do not handle well.
What this skill is for
Use this skill when the user asks for richer chart behavior than a default Recharts chart provides. Typical requests include:
- make legend hover highlight the matching stacked series
- hide or restore a series by clicking a legend item
- make tooltip ordering match the visible stack order
- add
Totalrows to stacked tooltips - stop pie labels from flickering or disappearing on hover
- keep interactive charts understandable on mobile
This skill is especially useful when several charts share the same series metadata and should behave consistently.
Quick start
Start from one shared series array and derive areas, legends, tooltips, and tables from it. If the dashboard has more than one chart, keep interaction state keyed by chart id so one chart does not accidentally affect another unless that is a deliberate product decision.
Workflow
- Create a single metadata array for series keys, labels, colors, and any scenario-specific behavior.
- Keep hover and hidden state keyed by chart id when several charts reuse the same buckets.
- Render stacked series from a filtered
visibleBucketsarray, but keep the full bucket list in the legend so hidden series can be restored. - Use a custom tooltip component for stacked charts and reverse the Recharts payload so the text order matches the visible layer order on the chart.
- Use a custom HTML legend when you need hover highlight, dimming, strike-through hidden states, or click-to-toggle behavior.
- Disable pie label animation when hover causes label blinking or disappearing percentages.
- Validate in a real browser after each interactive change.
Implementation sequence
Use this order when building or refactoring:
- Normalize bucket or series metadata first.
- Make the static chart render correctly before adding interaction.
- Add tooltip customization and verify ordering.
- Add legend hover behavior.
- Add click-to-hide or click-to-restore behavior.
- Add responsive and mobile adjustments last.
This keeps the debugging surface small and makes regressions easier to isolate.
Core Rules
- Prefer custom legend buttons below the chart instead of Recharts' built-in
Legendwhen the legend must change hover or visibility state. - Keep hidden state per chart, not global, unless the product explicitly wants all charts to hide the same bucket together.
- Fade non-hovered stacked areas with lower
fillOpacityandstrokeOpacity, and optionally add a glow to the active series. - Add a
Totalrow to stacked tooltips so users do not need to sum series mentally. - For pie and donut charts, dim non-hovered slices and matching labels together to preserve visual focus.
Common failure modes
- Tooltip payload order does not match the visible stack order.
- Hidden series disappear from both the chart and the legend, making them impossible to restore.
- Pie labels flicker because hover and animation fight each other.
- One global hover state leaks across several independent charts.
- Legend interactions work on desktop but become cramped or unreadable on smaller screens.
When debugging, solve these one at a time instead of changing legend, tooltip, and responsiveness all at once.
Validation
- Build the project and check for chunk warnings or lint regressions.
- Use a real browser to verify hover highlight, tooltip ordering, click-to-hide, and click-to-restore.
- When the chart is responsive, test at least one desktop width and one mobile width.
- If the chart is used on production or in an investor-facing deck, verify the exact visible text order and totals, not just whether the chart renders.
References
- Open
references/patterns.mdfor code skeletons and the recommended state shape.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/recharts-stacked-interactivity/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tech-hy/skills/recharts-stacked-interactivity)