Skip to main content
100%

Vega-Lite API Template

✓ Published0🌍 Public
GGonzalo Alarcón Usui
Last edited Dec 2, 2021
Created on Dec 2, 2021

This example demonstrates a bar chart of presidential election totals by candidate, with bars sorted in descending order and tooltips showing the total votes for each candidate. The visualization uses the Vega-Lite API to declaratively define the chart specification, while D3’s `csv` loader fetches the dataset from a Gist, and the UCI Auto MPG data source is referenced. The code registers Vega and Vega-Lite libraries, applies a custom configuration for axis and label styling, and renders the output as a full-screen, responsive SVG using the `vega-lite-api` `render()` method.

AI-generated description

A 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.

MIT Licensed

Similar vizzes