2๐
โ
The problem: I was calling the function before the canvas be loaded on the view, so I used a setTimeout()
to call the writeBatteryChart()
with a delay in order to wait the canvas be rendered.
0๐
You have to add your rendered things inside of canvas. Hope it will help Link
Source:stackexchange.com