Skip to main content
Public

Share visualization

Loading preview…

Making a Bar Chart

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

Making a Bar Chart

1
CChinzorigt Ganbat
Last edited Sep 18, 2020
Created on Sep 17, 2020

This example shows a horizontal bar chart of dividend values for seven companies, with company names on the y-axis and a linear scale for the dividend amounts on the x-axis. The chart uses `d3.csv` to load the data, `scaleBand` for the categorical y-axis, `scaleLinear` for the numeric x-axis, and `axisLeft` and `axisBottom` to render the axes. Bars are drawn as SVG `rect` elements with `fill: steelblue`, using `csv` loading and a margin-based layout with an inner plotting area.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed