Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Vega-Lite API Template Bar Chart

Public visualization

Viewing a saved revision (read-only)

6a1d02adbc204363b83603133f55ada5

Vega-Lite API Template Bar Chart

0 stars1🌍 Public
MMilena Belianovich Holtman
Last edited Oct 12, 2022
Created on Oct 12, 2022

This bar chart visualizes the population of each country in 2015, using a horizontal bar for each nation. Constructed with the Vega-Lite API, the chart serializes a declarative specification through `vl.markBar()` and `vl.x().fieldN('country')`/`vl.y().fieldQ('population')`. The code registers Vega, Vega-Lite, and the tooltip handler, then loads CSV data from a GitHub gist via `d3.csv`. The visualization renders to SVG and adapts to the browser window size.

AI-generated description

A visualization constructed using the vega-lite-api.