reactchartjs / react-chartjs-2

React components for Chart.js, the most popular charting library
https://react-chartjs-2.js.org
MIT License
6.58k stars 2.37k forks source link

[Bug]: Remembering options at charts based on same element #1207

Open iBreadInside opened 9 months ago

iBreadInside commented 9 months ago

Would you like to work on a fix?

Current and expected behavior

Current behavior: Few same chart components renders with same options.

Expected behavior: Providing different options as props causes different charts visualization.

Sandbox: https://codesandbox.io/p/sandbox/same-chart-components-different-options-6l3y5g?file=%2Fsrc%2FApp.js%3A11%2C55

Reproduction

  1. Make a chart component with options as a prop; 2. Render two or more of it; 3. Provide different options as a props;

chart.js version

4.4.0

react-chartjs-2 version

5.1.0

Possible solution

No response