You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Multiple charts using ContinuousColorsLegendSvg (like Heatmap) share the same legend color scale even if differing colors were passed to them as props.
Pass them the required props along with 1 legend for each chart
Define differing colors for each chart
Notice that all charts share the same color scale for their legends
Expected behavior
Each chart's legend to inherit the chart's coloring and not share the same color scale.
Screenshots
Additional context
The bug appears to come from the non-unique id generation inside ContinuousColorsLegendSvg resulting in an id conflict inside the DOM.
The text was updated successfully, but these errors were encountered:
palatinus-sb
changed the title
Multiple charts using ContinuousColorsLegendSvg share the same legend color scale
Multiple charts using ContinuousColorsLegendSvg share the same legend color scale
Feb 10, 2025
Description
Multiple charts using ContinuousColorsLegendSvg (like Heatmap) share the same legend color scale even if differing colors were passed to them as props.
To Reproduce
CodeSandbox showcasing the bug: https://codesandbox.io/p/sandbox/nivo-legends-bug-y6l5kd
Steps to reproduce the behavior:
legend
for each chartcolors
for each chartExpected behavior
Each chart's legend to inherit the chart's coloring and not share the same color scale.
Screenshots

Additional context
The bug appears to come from the non-unique
id
generation inside ContinuousColorsLegendSvg resulting in an id conflict inside the DOM.nivo/packages/legends/src/svg/ContinuousColorsLegendSvg.tsx
Line 55 in af22689
The text was updated successfully, but these errors were encountered: