Multiple Visualizations with chart.js – Designing with Data

Опубликовано: 13 Май 2026
на канале: Jeff Thompson
404
0

Ok, but what if we want multiple visualizations on the same page? To do this, we need a few things:

index.html: create additional canvas elements and add an ID (like a unique identifier) to each one

sketch.js: create your visualization as usual, then change the ID when the chart gets created to target the canvas elements we made earlier

That's it!

👩‍💻 https://editor.p5js.org/jeffThompson/...

ALL THE VIDEOS IN THIS UNIT
🎥    • Designing with Data: Adding Context to You...  

CHALLENGES
❓ Can you change the ID of the visualizations here and in the index.html file? Do you still see both charts?
❓ Can you copy/paste one of the chart's code and display it in a third canvas?