recharts-stacked-interactivity

Implements interactive stacked Recharts dashboards with custom legends, tooltips, and hover states.

Updated Mar 22, 2026
One-click install
npx skills add https://github.com/TECH-HY/SKILLS --skill recharts-stacked-interactivity-tech-hy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: recharts-stacked-interactivity
Source: https://github.com/TECH-HY/SKILLS/tree/main/skills/recharts-stacked-interactivity
Command: npx skills add https://github.com/TECH-HY/SKILLS --skill recharts-stacked-interactivity-tech-hy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Default Recharts Legend and Tooltip components fall short when dashboards need hover highlighting, click-to-hide series, tooltip ordering that matches the visual stack, or stable pie and donut labels, leaving developers to debug flickering labels and mismatched payload order on their own. ## Core Features & Use Cases - Custom HTML legends: Build legend buttons that highlight the matching stacked series on hover and toggle series visibility on click while keeping hidden series restorable. - Deterministic stacked tooltips: Reverse the Recharts payload so text order matches the visible layer order and append a Total row for quick summation. - Per-chart interaction state: Keep hover and hidden state keyed by chart id so multiple charts sharing the same series metadata behave independently. - Pie and donut stability: Disable label animation and dim non-hovered slices with their labels to stop flickering on hover. - Use Case: A React analytics dashboard shows token unlock schedules as stacked area charts alongside allocation donut charts; use this Skill to add legend-driven highlighting, click-to-toggle series, correctly ordered tooltips with totals, and mobile-safe layouts. ## Quick Start Ask the agent to use the recharts-stacked-interactivity skill to add hover-highlight legends and click-to-toggle series to your stacked Recharts dashboard.

Frequently Asked Questions about recharts-stacked-interactivity

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I highlight a Recharts stacked series on legend hover?

Replace the built-in Recharts Legend with custom HTML buttons that set hover state on mouse enter and clear it on mouse leave. Then fade non-hovered stacked areas with lower fillOpacity and strokeOpacity so the hovered series stands out.

How to hide and restore a series by clicking a Recharts legend item?

Track hidden series ids in state per chart, filter them out of the rendered areas via a visibleBuckets array, but keep the full bucket list in the legend. Clicking a legend button toggles the id in the hidden array so the series can be restored.

Why does my Recharts tooltip order not match the stack order?

Recharts tooltip payload order often differs from the visual top-to-bottom stack order. Fix it by reversing the payload array before rendering and optionally appending a Total row computed by summing the payload values.

Why do Recharts pie chart labels flicker on hover?

Pie labels flicker when hover state changes fight with label animation. Set isAnimationActive to false and dim non-hovered slices together with their outside labels to keep the chart stable.

Can multiple Recharts charts share series metadata without sharing hover state?

Yes, keep one shared bucket metadata array for labels and colors, but key hover and hidden state objects by chart id. Each chart then responds independently unless you deliberately want synchronized behavior.