🌍 Public
Viewing a saved revision (read-only)
ed0ede1d3311440d9a5753e297d652bf
Vega-Lite API Bar Chart
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 descriptionBar chart example