Command Palette

Search for a command to run...

Hectal
Phase 3: Charts by Hand, No Library
Data Visualization · Exercise 5 of 5 Previous
Intermediate

A bar chart that survives empty data

render(rows) draws one SVG bar per row. With an empty array it should instead write No data into #msg and draw no bars, without any SVG error.

Add the check at the start of render. Bars must still stand on the baseline at y = 100.

What Check tests

  1. Three bars for three rows, the tallest 100 high
  2. Every bar's bottom is at y = 100
  3. With no rows, #msg says No data and no bars remain
  4. No NaN anywhere after the empty render

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.