🌍 Public
Viewing a saved revision (read-only)
58a5a3631b404afca34df75af70ba200
Adding Interaction to My Bar Chart
PPatrick-Houlihan
Last edited Oct 7, 2021
Created on Oct 7, 2021
Forked from Improving a Bar Chart for 2017 Baseball Hitting
This bar chart visualizes the percentage of at bats ending in a hit by pitch for 2017 MLB players with at least 10 HBPs, sorted from highest to lowest rate. Color intensity encodes each player’s total at bats relative to peers, with a legend showing the scale from 276 to 622 at bats. The chart uses D3 v5 with SVG rendering, employing `scaleLinear`, `scaleBand`, and `scaleOrdinal` for scales, `d3.interpolateOrRd` for the color ramp, and `d3.schemeOrRd` for the legend. Mouseover and mouseout events change bar fill and stroke, with a tooltip displaying raw HBP counts. Data comes from a GitHub gist CSV file.
AI-generated description