Summary

In this chapter, you learned how to load data from the web and use it as the basis for a bar graph. We started with loading data in the JSON, CSV, and TSV formats. You learned how to use the .map() function to extract just the values that you desire from this data, and examined the issues and solutions needed for converting string values into numeric values.

Next we covered scales in some more detail, and looked at several examples of the ways to use scales for mapping data from one range of values to another as well as to map discrete values such as color names to color codes. We covered categorical scales, a means of mapping integer values into predefined color maps, and a concept that we will use frequently in our examples. Our examination of scales ended with a demonstration of using .rangeBands(), and how it can help us size and place bars within a predefined area.

We closed the chapter by combining all of these concepts together into, what is up to this point, our best example of generating a bar chart. This demonstrated loading the data, using multiple scales for both data and axes, and using .rangeBands() to determine the placement of the bars, as well as using not only a vertical but also a horizontal axis.

In the next chapter, we will branch out of bar graphs into another type of data visualization—scatter (and bubble) plots.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.150.169