官术网_书友最值得收藏!

Basic Charts and Shapes

In the previous chapter, we created a simple bar chart using the SVG rect element. While this works for simple charts, using the standard SVG elements for more complex charts can be difficult. Luckily, D3 provides an extensive set of helper functions that we can use to easily create more complex visualizations, without having to manipulate basic SVG elements ourselves. In this chapter, we're going to create visualizations based on data from the US Census Bureau (http://www.census.gov). To be more precise, we're going to create the following data visualizations:

  • How long have American firms been in business visualized with pies and donuts: The US census releases an overview that shows how long firms have been in business. This provides a nice data set to show how D3 allows you to create pie and donut charts.
  • Real Median Household income in the US visualized with a line chart: In the US Census data, there is information present on how the average household income has changed during the last thirty years. This is information that can be very nicely visualized using a line chart.
  • Population growth estimates using a stacked graph: The US Census Bureau provides information on how the population of the US is expected to change from 2014 to 2060. We'll use this data to show how this can be visualized using a stacked graph.

To make the visualizations more interesting, we'll also add interactivity and animations to them. Let's get started with the first visualization: the donut and pie charts.

主站蜘蛛池模板: 光泽县| 林芝县| 曲松县| 宜川县| 七台河市| 长寿区| 抚顺县| 集安市| 宜丰县| 泽普县| 西乌珠穆沁旗| 铜陵市| 墨竹工卡县| 晋江市| 南昌县| 夏津县| 西昌市| 勐海县| 冕宁县| 钟祥市| 九江县| 肇源县| 龙川县| 绿春县| 泗水县| 安阳县| 海丰县| 伊金霍洛旗| 吐鲁番市| 黔西县| 漳平市| 若羌县| 涡阳县| 阿克陶县| 溆浦县| 讷河市| 龙川县| 余干县| 漾濞| 宁津县| 水富县|