2

Im trying to use chartjs-2 Bar component to show registered data by user for each day. Each day can vary depending on how many times user decided to register data.

But what I want is to group values for the dates and show the data that the user has registered for that specific date.

X-axis can be like: 2022-11-20 -> data registered 3 times with different values 2022-11-21 -> data registered 1 times with different values 2022-11-22 -> data registered 10 times with different values

How do I match the registered data with the labels? Ive seen it as a problem since datasets requires array of objects and labels is just an array with values.

I tried to match the values but I realized that each dataset objects is based on the index of the value in the labels array

This: dataset

Gives: frontend

And this: dataset

gives: frontend

Shortly my question is how do i match the label with the dataset data value? Cause Im going to get the data from an api and somehow try to map it correctly. But not really sure if it is going to work with this library?

Asded
  • 21
  • 2

0 Answers0