Command Palette

Search for a command to run...

Hectal
Back to the lesson: Topic 0.1 — What You Will Learn and What You Get
Data Visualization · Example 2 of 2

Your first edit: a number becomes a size

Try 250, then 400 (wider than the drawing area), then -5. The "Try it" and "Break it" sections below say what happens.

This course takes you from drawing one rectangle to building a live, fast, accessible dashboard. Here is the whole route, what you will be able to do at the end, and what you need before you start.

Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.

Ready for more? This phase has 5 hands-on exercises with automatic checks.

Practice questions

Write the code in the editor, run it, then open the model answer to compare.

01

Look at the preview chart. Write down the busiest month, the quietest month, and one sentence that describes the year.

02

Change the second example so the bar is exactly half the width of the drawing area. What number did you use, and why?

Explain it without notes

01

In your own words, what is a chart?

02

Why does this course draw charts by hand before it uses D3?

03

Name three things you will be able to build or do at the end of the course.

Your first edit: a number becomes a size

Preview

Press Run to see the page.

Console

Nothing logged yet.

Expected console output

The bar is 120 pixels long.
The drawing area is 320 pixels wide.