You may encounter a problem where certain events, such as hover tooltips, inadvertently trigger the merging of datasets in a chart. This issue occurs because the library requires a unique key to track changes in dataset series, and in the absence of such a key, it cannot distinguish between datasets during updates.
To address the problem, you have two possible solutions:
Add a label to each dataset. react-chartjs-2 uses the label property as the default key to distinguish datasets.
You can specify a different property to be used as a key by passing a datasetIdKey prop to your chart component.