0👍
The problem is that you create the chart before the CSV
data is loaded. Be aware that the d3.csv
request is processed asynchronously.
This can be solved by creating the chart only once the CSV
data is fully loaded (at the end and inside of d3.csv(file).then( ...
).
An alternative approach is described in this answer.
- Chartjs-Chart.js change colour of line chart graph based on previous values
- Chartjs-How to show label for second y-axis in charts.js?
Source:stackexchange.com