Viewing a saved revision (read-only)
33e6e7143afe41d198c2ba68ce56e0d9
Vega-Lite API Template for bar chart
This example renders a bar chart of country populations using the Vega-Lite API, with data loaded from a CSV via D3’s `csv` function. The chart shows population counts per country, sorted descending, using `vl.markBar()` and encoding fields for country and population. The code integrates Vega-Lite with D3 v6, configures axis styling and tooltips via Vega Tooltip, and resizes the visualization to fit the window. The data originates from the UCI Auto MPG dataset, though the actual values shown come from a population-by-country gist.
AI-generated descriptionA 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.