Skip to main content
100%

Vega-Lite Grouped Bar Chart

✓ Published2🌍 Public
CCurran Kelleher
Last edited Sep 10, 2019
Created on Sep 10, 2019

This interactive visualization uses a grouped bar chart to compare average BMI between smokers and non-smokers across different regions, making adjacent bar comparisons straightforward. Built with Vega-Lite and rendered via the `vega-lite-api`, the visualization encodes region as columns, smoker status as x-axis and color, and average BMI as the y-axis. The data is loaded from a remote CSV using `d3.csv`, while custom axis styling removes domain lines and increases font sizes for readability. Tooltips display the average BMI on hover.

AI-generated description

A fork of the same data visualized as a stacked bar chart.

When visualizing using a grouped bar chart like this, visual comparisons between the adjacent bars are much easier to make. This makes it easier to answer the question "Do smokers have higher or lower average BMI than non-smokers, and how does that vary by region?", as compared to the stacked bar chart.

MIT Licensed

Similar vizzes