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
- Three bars for three rows, the tallest 100 high
- Every bar's bottom is at y = 100
- With no rows, #msg says No data and no bars remain
- 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.