Stacked Bar Chart with Color Legend
This stacked bar chart displays the number of tourists visiting Thailand per year, aggregated by region, with each bar segment colored according to its regional origin. Built with the vega-lite-api on top of Vega-Lite and Vega, it loads data from a remote CSV file using d3.csv and renders an interactive SVG with a color legend via the `vl.color().fieldN('region')` encoding. The visualization uses a custom config to adjust axis and label styling, a tooltip handler for hover details, and `autosize` fitting to maintain proper dimensions.
AI-generated descriptionA visualization constructed using the vega-lite-api.
The visualization comes from Data.World : Thai Tourism Data Set. It's designed to emphasize the number of "tourists coming to Thailand" each year, aggregating by the regions. Each stacked bar represented the total number of tourists.