Skip to main content
100%

Fork of Responsive Bar Chart

✓ Published0🌍 Public
NNanditha Reddy
Last edited Mar 19, 2024
Created on Mar 19, 2024

This example demonstrates a minimal React bar chart component that uses D3.js to render a single rectangular bar. The visualization shows a static SVG rectangle positioned at coordinates (50, 50) with a width and height of 50 pixels, filled with a steelblue color. The code initializes the chart by selecting the SVG element via `d3.select` and appending the rectangle through D3's declarative API. The rendering relies on React's `useEffect` hook to manage the D3 manipulation, while the SVG is defined directly in the JSX with an 800×400 viewport. The data source is hardcoded, and no scales or axes are implemented.

AI-generated description
MIT Licensed

Similar vizzes