Skip to main content
100%

Vega-Lite API Bar Chart

✓ Published0🌍 Public
CCaroline Ghisolfi
Last edited Dec 18, 2022
Created on Dec 18, 2022

This bar chart visualizes the top five religions by country, with bars color-coded by religion and a tooltip displaying the religion name for each segment. The example demonstrates the Vega-Lite API for declarative chart construction, using `vl.markBar()` and `vl.encode()` to define marks and channels. It loads CSV data via `d3.csv` and renders with Vega-Lite, compiling to Vega for SVG output. The chart is customized through a config object that adjusts axis styling, font sizes, and colors, while the layout adapts to the window size.

AI-generated description

Bar chart example

MIT Licensed

Similar vizzes