Skip to main content
100%

Vega-Lite API Stacked Bar Chart Template

✓ Published0🌍 Public
Ppjdhungana@gmail.com
Last edited Jul 14, 2023
Created on Jul 14, 2023
Forked from Hello VizHub

This example demonstrates a stacked bar chart generated using the Vega-Lite API, with data loaded from a CSV of religious demographics by country. The code imports the vega, vega-lite, and vega-lite-api libraries, registers them together, and configures a custom tooltip handler. The visualization renders as an SVG that fills the entire viewport, using the `autosize` fit option and custom axis and label styling defined in a separate configuration module. The data is fetched asynchronously via D3's `csv` function.

AI-generated description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.
MIT Licensed

Similar vizzes