React-chartjs-2: line chart only shows first 2 datasets

Created on 19 Jan 2019  路  2Comments  路  Source: reactchartjs/react-chartjs-2

I'm trying to get data in realtime using sockets. But the line chart only displays the first two data even though all the data is coming in perfectly.

question

Most helpful comment

I had the same issue, but this was solved by providing an array of labels in the data object. This will populate the X-axes. Let me know if it works for you:

          <Line data={{
            labels: this.state.labels,
            datasets: [
              {
                label: 'values',
                data: this.state.values,
              }
            ]
          }}
        />

Can you answer me one thing? Does the chart animate the values? It does not for me.

All 2 comments

I had the same issue, but this was solved by providing an array of labels in the data object. This will populate the X-axes. Let me know if it works for you:

          <Line data={{
            labels: this.state.labels,
            datasets: [
              {
                label: 'values',
                data: this.state.values,
              }
            ]
          }}
        />

Can you answer me one thing? Does the chart animate the values? It does not for me.

See #375

Was this page helpful?
0 / 5 - 0 ratings

Related issues

davidcalhoun picture davidcalhoun  路  5Comments

thanh121094 picture thanh121094  路  3Comments

pkellner picture pkellner  路  4Comments

cbroberg picture cbroberg  路  5Comments

justinmasse picture justinmasse  路  3Comments