Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Responsive Axes

Public visualization

Responsive Axes

0 stars0🌍 Public
ZZakir Hussain
Last edited Apr 2, 2020
Created on Apr 2, 2020
Forked from Responsive Axes

This example demonstrates axes that adjust to the browser window size, with a simple bar chart showing grocery item prices. A resize event listener calls a render function that rebuilds the visualization using the updated viewport dimensions. The implementation applies D3 v5’s margin convention to compute inner dimensions, then uses `d3.axisBottom` and `d3.axisLeft` with dynamic tick counts based on pixel density. Axes are labeled via custom functions, and SVG elements are updated through data joins, ensuring the chart remains responsive.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed