Skip to main content
100%

Stacked bar

✓ Published0🌍 Public
TThaverman
Last edited Aug 19, 2022
Created on Aug 19, 2022

This stacked bar chart shows the top 10 NASCAR drivers by total wins across different tracks from 1975 to 2003, with each bar segmented by track and colored accordingly. It uses vega-lite API to create the visualization, loading data from a CSV file via d3.csv. The bars are sorted descending by win count, and a tooltip displays the driver name and track-specific win totals. The color scale maps track names to distinct colors, while config.js customizes axis and label styling. The encode method specifies x, y, and color channels with count aggregation.

AI-generated description

This bar chart displays the top 10 drivers in terms of wins in the dataset, with the bars broken down and colored by their wins at particular tracks. So, for example, the driver Darrell Waltrip leads drivers during this time period with 84 wins, and those wins are split by the tracks they occured at. A tooltip was added to display the track name, and the number of wins there. In order to display just the top 10, a variable was added to the dataset called "IsInTop10" and added to rows for those drivers. This data comes from a rendition of the NASCAR dataset, which spans from 1975 to 2003.

Goal: When added to the dashboard, I would like this viz to highlight the portion of the bars pertaining to the selected track.

MIT Licensed

Similar vizzes