Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Making a Bar Chart

Public visualization

Viewing a saved revision (read-only)

7db3816c596743189bb6c8e6fcb778fe

Making a Bar Chart

0 stars0🌍 Public
Aabhi254
Last edited Aug 12, 2019
Created on Aug 12, 2019

This example demonstrates how to size an SVG element to match its containing HTML div and redraw when the browser window changes size. It loads employee salary and ZIP code data from a CSV file using d3.csv, though the visualization only renders the initial screen dimensions as a green X composed of two thick lines. The code extracts container dimensions via clientWidth and clientHeight, sets the SVG width and height attributes accordingly, and uses a resize event listener to trigger the redraw function.

AI-generated description