Skip to main content
100%

Fork of Fork of colorado county data bar chart pt 2

✓ Published6🌍 Public
Ooliverkendall99@gmail.com
Last edited Dec 5, 2024
Created on Nov 21, 2024

This example displays a stacked bar chart of yes and no votes for a Colorado ballot proposition, with one bar per county. Hovering over a county bar currently shows a tooltip, though the tooltip event handlers are commented out, so the feature is inactive. The visualization uses d3.csv and d3.json to load voting data from a CSV and county boundaries from a GeoJSON file, then renders the chart with d3.stack, d3.scaleBand, d3.scaleLinear, and d3.axisBottom. It also implements zoom and pan capabilities using d3.zoom with an invisible overlay rect to capture pointer events.

AI-generated description

An example showing the capabilities of VizHub:

  • if you hover over a county it will display the number of yes votes and no votes for the current proposition
  • TODO:
  • -color the map according to the number of votes
  • -add a selector for multiple propositions
  • -clean up code and functions into multiple classes
MIT Licensed

Similar vizzes