Command Palette

Search for a command to run...

Hectal
Phase 3: Charts by Hand, No Library
Data Visualization · Exercise 2 of 5 PreviousNext
Beginner

Move the plot area inside the margins

The SVG is 400 × 200 with margins top 20, right 20, bottom 30, left 50. The group #plot should start at the plot area's corner, and the frame inside it should be exactly the plot area's size.

In the script, set #plot's transform to translate(50,20) and the frame's width and height from innerWidth and innerHeight.

What Check tests

  1. The frame is 330 wide and 150 tall
  2. The plot group is translated to (50, 20)
  3. The frame ends 20 pixels before the right edge

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.