Chapter 2. Transforming Data with ActiveRecord and D3

There are so many good examples of D3 charts ranging from very simple to very intricate. My typical workflow is to find an existing example that does generally what I am looking for and use that as my foundation or inspiration. That’s what we did in the previous chapter.

Once I have the data lined up and the graph in place I can start tweaking it. That’s exactly what we are going to do with the simple pie chart we made in the previous chapter.

Pie Chart Revisited

The labels in our pie chart are a bit jumbled. We have a lot more slices in our pie than the example, and there are too many slices that are small and have similar colors. It is not very clear at a glance exactly what the chart is ...

Get Data Visualization Toolkit: Using JavaScript, Rails™, and Postgres to Present Data and Geospatial Information now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.