Skip to main content
100%

Stacked Bar Chart Creation

✓ Published1🌍 Public
SSwapna1915
Last edited Jul 19, 2023
Created on Jul 17, 2023
Forked from Hello VizHub

This example shows a stacked bar chart of tourist counts by region across years, using a color-encoded legend and tooltips for interactivity. The visualization is built programmatically with the Vega-Lite API (`vl.markBar`, `vl.x`, `vl.y`, `vl.color`, `vl.tooltip`), which is registered with Vega and Vega-Lite via `vl.register`. Data is loaded asynchronously from a CSV file using D3's `csv` function, and the chart is rendered as an SVG within the body of the page. Appearance is customized through a config object that sets axis, tick, and label colors.

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