The CSV file at https://flunky.github.io/cars2017.csv contains average data for 2017 automobile manufacturers. Create a
Posted: Sun Jul 03, 2022 10:00 am
The CSV file at https://flunky.github.io/cars2017.csv containsaverage data for 2017 automobile manufacturers.
Create a scatter plot of this data over a 200x200 asfollows.:
- Plot the Average City MPG horizontally on a logarithmicscale.
- Plot the Average Hightway MPG vertically on a logarithmicscale.
- Set the radius of each circle to 2 plus the number ofcylinders for that entry.
- Set the logarithmic scales to base 10, over a domain from 10to 150.
- Use the .tickValues() method of each axis to set four tickvalues at 10, 20, 50 and 100.
- Use the .tickFormat() method of each axis to set the ticks tod3.format("~s").
Given code below:
<html><scriptsrc='https://d3js.org/d3.v5.min.js'></script><style> circle {fill: lightblue; stroke: black;}</style><body onload='init()'><svg width=300 height=300></svg><script>async function init() {
// ANSWER HERE
}</script></body></html>
Result should look like this:
100 50- 20 10+ 10 20 50 。。 100 8080
Create a scatter plot of this data over a 200x200 asfollows.:
- Plot the Average City MPG horizontally on a logarithmicscale.
- Plot the Average Hightway MPG vertically on a logarithmicscale.
- Set the radius of each circle to 2 plus the number ofcylinders for that entry.
- Set the logarithmic scales to base 10, over a domain from 10to 150.
- Use the .tickValues() method of each axis to set four tickvalues at 10, 20, 50 and 100.
- Use the .tickFormat() method of each axis to set the ticks tod3.format("~s").
Given code below:
<html><scriptsrc='https://d3js.org/d3.v5.min.js'></script><style> circle {fill: lightblue; stroke: black;}</style><body onload='init()'><svg width=300 height=300></svg><script>async function init() {
// ANSWER HERE
}</script></body></html>
Result should look like this:
100 50- 20 10+ 10 20 50 。。 100 8080