-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi! Could you give a codesandbox of the initial state of your chart so others can try to help? |
Beta Was this translation helpful? Give feedback.
-
Hi @idjuradj , thanks for the question, that is an interesting one! I believe this is exactly what you want -> Codesandbox The solution is very simple, use a state to keep the selected radial bar name, and use <RadialBar
background
dataKey="uv"
>
{data.map((entry, index) => (
<Cell
key={`cell-${index}`}
opacity={selectedRadialBar === entry.name ? 1 : 0.1}
/>
))}
</RadialBar>
<Legend
iconSize={10}
width={120}
height={140}
layout="vertical"
verticalAlign="middle"
wrapperStyle={style}
content={({ payload }) => (
<ul>
{payload?.map((entry, index) => {
return (
<li
onClick={(data) => setSelectedRadialBar(entry.value)}
key={`item-${index}`}
style={{
color: entry.color,
}}
>
{entry.value}
</li>
);
})}
</ul>
)}
/> Also, if you want the legends get the related opacity, you can add |
Beta Was this translation helpful? Give feedback.
Hi @idjuradj , thanks for the question, that is an interesting one!
I believe this is exactly what you want -> Codesandbox
The solution is very simple, use a state to keep the selected radial bar name, and use
Cell
as a child ofRadialBar
to get control of the selected radial bar opacity.