Skip to main content
100%

Vega-Lite API Religion Stacked Bar Chart

✓ Published0🌍 Public
LLem Dulfo
Last edited Mar 11, 2021
Created on Mar 11, 2021

This example presents a stacked bar chart visualizing the population of each country segmented by religion, using data from a CSV file about religion by country. The chart sorts countries by total population in descending order, with each bar colored by religion and tooltips revealing the specific religious group. Built with the Vega-Lite API, the code registers vega and vega-lite, then uses `vl.markBar()` to encode the x-axis as country, y-axis as population, and color as religion. The visualization loads data via `d3.csv` and renders as SVG, with customizable axes and labels from the configuration file.

AI-generated description

A visualization constructed using the vega-lite-api.

The data shown here comes from the UCI Machine Learning Repository: Auto MPG Data Set, via Gist: Scatter Plot with Menus.

MIT Licensed

Similar vizzes