Vega-Lite API Bar Chart Template
This example shows a bar chart of country populations for 2015, with bars sorted in ascending order along the x-axis and tooltips displaying the population value for each country. It uses the Vega-Lite API to construct the chart specification programmatically, combining mark definitions, encoding channels, and data binding in a concise JavaScript interface. The chart renders through Vega and Vega-Lite, with the data loaded from a CSV file using d3.csv, and includes a custom config to adjust axis styling. The visualization is built from a template that registers the Vega-Lite API and integrates Vega Tooltip for interactive hover details.
AI-generated descriptionA 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.