Skip to main content
100%

Vega-Lite API

✓ Published0🌍 Public
EEdward Chung
Last edited Nov 1, 2023
Created on Nov 1, 2023

This example demonstrates how the Vega-Lite API can be used to create an interactive line chart showing the price of electricity over time. The visualization plots a single series of Price values against a Date axis, with a tooltip that displays the exact price on hover. The code imports data from a CSV file hosted on GitHub, likely derived from the UCI Auto MPG dataset, and renders the chart using Vega-Lite’s `markLine` encoding. The implementation leverages the `vega-lite-api` library, registered with Vega and Vega-Lite, along with D3’s `csv` loader and the Vega Tooltip handler for interactive feedback.

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