0👍
The problem is that axios.get
makes an asynchronous HTTP request and assigns a value to the variable dataget
only once it receives a response (inside the Promise.then()
function). The chart however is created when the variable dataget
is still undefined.
Move the entire code block located between the two comments // this is a test to the Promise.then()
function just after the following code line and it should work.
dataget = response.data._size;
- Chartjs-How to create a graph where the vertical axis (Y-axis) is a string?
- Chartjs-Using chartjs to limit data?
Source:stackexchange.com