Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Vega-Lite API Template to tinker with

Public visualization

Viewing a saved revision (read-only)

af4adb70fe0643bdb88bdbc493a94ea5

Fork of Vega-Lite API Template to tinker with

0 stars0🌍 Public
RRyan Johnson
Last edited Jul 3, 2021
Created on Jul 3, 2021

This example shows a bar chart of population by country, with bars colored by religion and a tooltip displaying population values on hover. It loads data from a CSV file hosted in a GitHub gist, then renders the visualization using the Vega-Lite API (vl) with a concise specification: markBar encoding country on the x-axis (sorted descending by population), population on the y-axis, and religion as color. The code imports vega, vega-lite, vega-lite-api, d3.csv for data loading, and vega-tooltip for interactive tooltips, with custom axis and label styling configured in a separate config.js file. The visualization dynamically sizes to the full window and uses an SVG renderer.

AI-generated description

A visualization constructed using the vega-lite-api.