Use same chart across multiple canvas

194 views Asked by At

How can I use the same chart to be rendered across multiple canvas. I want to create one ChartJs object and assign it to multiple canvas.

1

There are 1 answers

0
LeeLenalee On

You can't, what you can do is create 1 config object and call new Chart multiple times each time with another canvas id.

Other solution is to create the chart once and call .toBase64Image() on it and set that as an image source for multiple images so that you only have to create your chart once but can show it multiple times