0

I am using react chart js. iI had added bar chart in my page, my chart data is:

const data = {
          labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
          datasets: [
            {
              backgroundColor: '#db3eb1',
              data: [7, 8, 3],
            },
            {
              backgroundColor: '#db3eb1',
              data: [0, 9, 7],
            },
            {
              backgroundColor: '#db3eb1',
              data: [0, 10, 12],
            },
          ],
        };

Then I try to change this data into dynamically but it not working properly. The dynamic data is:

[{"backgroundColor":"#db3eb1","data":[1.119]},
{"backgroundColor":"#db3eb1","data":[1.103]},    
{"backgroundColor":"#db3eb1","data":[1.105]},    
{"backgroundColor":"#db3eb1","data":[1.096]},
{"backgroundColor":"#db3eb1","data":[1.22,1.097]},
{"backgroundColor":"#db3eb1","data":[1.092]}]

How to fix this issue?

user3382203
  • 169
  • 1
  • 6
  • 25
6round
  • 182
  • 4
  • 18

0 Answers0