Creating a scatterplot chart
A scatterplot or scattergraph is another common type of diagram used to display data points on Cartesian coordinates with two different variables. Scatterplot is especially useful when you're exploring the problem of spreading, clustering, and classification. In this recipe, you will learn how to implement a multi-series scatterplot chart in D3.
Getting ready
Open your local copy of the following file in your web browser:
https://github.com/NickQiZhu/d3-cookbook-v2/blob/master/src/chapter8/scatterplot-chart.html
How to do it...
A scatterplot is another chart that uses Cartesian coordinates. Thus, a large part of its implementation is very similar to the charts we introduced so far; and therefore, the code concerning peripheral graphical elements are again omitted to save space in this book. Please refer to the companion code for the complete implementation. Now let's take a look the implementation of this recipe:
... _symbolTypes = d3.scaleOrdinal(...