0👍
There are two errors in your code.
- Your have to end the variable declaration with ; instead of ,
- You have to declare datacheck outside the if else block unless you want it undefined
componentDidMount() {
...
let dataCheck;
if(this.props.data2){
dataCheck = {
...
}
}
else {
dataCheck = {
...
}
}
}
- Chartjs-Aligning zero on y axis to the labels on x axis of line chart in chartjs
- Chartjs-Who knows why I can't plot my chart properly?
Source:stackexchange.com