2👍
✅
The getJson is an asynchronous function, so JS will send a request and then draw your chart before it gets a response.
Put all the chart stuff inside a function, and then call that function after the for loop inside your getJson callback.
Source:stackexchange.com