A Bar Chart
This bar chart displays Zika virus case counts for U.S. states, sorted alphabetically by state name, then transitions to a descending order by case count after a 5-second delay. The bars are rendered in green with black text and axes, using D3.js v3 to generate SVG elements and apply animations via `transition()`. Hovering over a bar triggers a tooltip showing the character length of the state’s name, while the x-axis scales linearly and the y-axis uses an ordinal scale for state labels, with data loaded from the `states-zika.csv` file.
AI-generated descriptionforked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/1389927'>A Bar Chart</a>
Make the following changes to this bar chart:
- Use the "states-zika.csv" file instead of "sample-data.csv".
- adjust margins as needed so that the entire bar chart is displayed properly.
- Make the bars green.
- Make all text black.
- Sort the bars alphabetically by state name in ascending order.
- After a 5 second delay, transition to sorting the bars in descending order according to their values.
- Create a tooltip for each bar that displays the number of characters in the name of the state over which you are hovering. For example, if I hover over Ohio, the tooltip will say "4". If I hover over Virginia, the tooltip will say "8".
forked from <a href='http://bl.ocks.org/scresawn/'>scresawn</a>'s block: <a href='http://bl.ocks.org/scresawn/9327a6642682b87430ec'>A Bar Chart</a>
forked from <a href='http://bl.ocks.org/BrandonStroud/'>BrandonStroud</a>'s block: <a href='http://bl.ocks.org/BrandonStroud/af2040b064e5d2e2e589'>A Bar Chart</a>