Skip to main content
100%

Customizing Axes

✓ Published1🌍 Public
Ttracy3057
Last edited Jun 18, 2021
Created on Dec 15, 2020
Forked from Customizing Axes

This example shows a horizontal bar chart of proposal counts for primary departments, with interactive year buttons (2013–2021) that let users switch between datasets. The chart uses D3 v6 APIs including `scaleLinear`, `scaleBand`, `axisBottom`, and `axisLeft` to construct the axes. A click on a year button updates the chart data and highlights the selected button, while bars are rendered as SVG rectangles. The x-axis formats tick labels with `.0s` and replaces "G" with "B", and hover states adjust bar opacity. The data is embedded as CSV strings within the code.

AI-generated description
MIT Licensed

Similar vizzes