Command Palette

Search for a command to run...

Hectal
Phase 1: SVG from Zero
Data Visualization · Exercise 4 of 5 PreviousNext
Beginner

Make a chart scale

The chart SVG has a fixed size of 380 by 210 and overflows a 200-pixel box.

Remove the fixed size and add width="100%" and viewBox="0 0 380 210". Don't change the shapes.

What Check tests

  1. The chart fits its 200 px box
  2. The viewBox is 0 0 380 210
  3. The height follows the shape (about 110.5)
  4. The bars are unchanged

Stuck? One hint at a time

The solution unlocks after your first Check. Try first: that is where the learning happens.

Runs in your browser. Your code is saved here.

Your page

Press Run to see the page.

Console

Nothing logged yet.