Skip to main content
Public

Share visualization

Loading preview…

Fork of Fork of Shapes and Colors with SVG and CSS-- ME

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

Fork of Fork of Shapes and Colors with SVG and CSS-- ME

1
Ddiegobrivo
Last edited Aug 13, 2022
Created on Aug 13, 2022

This example shows a bar chart of monthly values from a CSV file, using SVG rectangles positioned along a time-based x-axis and a linear y-axis scaled to the data’s maximum. The code loads data with `csv` from D3 v7, then uses `scaleBand` and `scaleLinear` to map each row to a bar’s position and height. A data join appends `rect` elements to the SVG, relying on the coordinate system’s top-left origin. The chart is styled minimally with CSS, which sets default margins and stroke properties.

AI-generated description

An example including some commonly used features of SVG.

Comments

Sign in to join the discussion.

MIT Licensed