Skip to main content
Public

Share visualization

Loading preview…

Fork of WeedPrices in 2011 fork

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 WeedPrices in 2011 fork

0
TTarun Kumar Bosupally
Last edited Mar 21, 2024
Created on Mar 21, 2024

This example shows a bar chart of the counts of entities from a dataset of U.S. senators, with each bar representing a distinct entity and its height mapped to the count. The visualization first displays the raw categorical distribution, then uses D3.js v7 to fetch the CSV data via `d3.csv` from a GitHub repository. The SVG rendering uses `d3.scaleBand` for the x-axis and `d3.scaleLinear` for the y-axis, with axes added via `d3.axisBottom` and `d3.axisLeft`, while labels are manually appended as SVG text elements. The chart is drawn in a React-compatible HTML page, though the script itself is plain JavaScript with D3.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed