Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Stacked Bars

Public visualization

Stacked Bars

1 star1🌍 Public
YYee Han
Last edited Dec 22, 2020
Created on Dec 22, 2020

This example displays a stacked bar chart of population by country and religion, with countries sorted by total population and each bar segmented by religious affiliation. The visualization is constructed using the Vega-Lite API, with the `vl.markBar()` method encoding the x-axis as country, y-axis as quantitative population values, and color as religion category. Data is loaded asynchronously from a CSV file via `d3.csv`, and the chart is rendered with SVG using Vega-Lite’s declarative specification, enhanced by a custom config for axis styling and tooltip support through Vega Tooltip.

AI-generated description

A visualization constructed using the vega-lite-api.

Comments

Sign in to join the discussion.

MIT Licensed