Check out a free preview of the full Data Visualization for React Developers course:
The "React and Bar Chart Exercise" Lesson is part of the full, Data Visualization for React Developers course featured in this preview video. Here's what you'd learn in this lesson:

In this exercise, students draw a bar chart with React and D3. - https://codesandbox.io/s/kop49w9r2v?module=%2Fsrc%2Fvisualizations%2FChart.js

Get Unlimited Access Now

Transcript from the "React and Bar Chart Exercise" Lesson

[00:00:00]
>> Shirley Wu: Let's do this exercise of drawing the bar chart. Now that we've calculated all of the data, and we figured out how to calculate the data, let's use react to do the rendering. And so here's the starter code, so go to under visualizations, go to Chart.js and then in these examples, we're just going to put the data calculations and to get derived state from props.

[00:00:31] Return it as state, and then use that to render a bunch of rectangles. And then if you do it right, it should show up right here.