Skip to main content
Public

Share visualization

Loading preview…

Bar Chart - React & D3 (Part 22) - Commercialised

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

Bar Chart - React & D3 (Part 22) - Commercialised

1
TTom-S82
Last edited Sep 8, 2020
Created on Aug 31, 2020

This bar chart displays the ten most populated countries in 2020 based on UN population estimates. Built with React and D3 v5, it renders SVG rectangles whose lengths animate from zero to their final values using the `<animate>` element. The chart uses `d3.scaleLinear` for the x-axis and `d3.scaleBand` for the y-axis, with axes split into separate files. Alternating blue and orange vertical gradients give the bars a 3D appearance, while a drop-shadow filter adds depth. Data is loaded via `d3.csv` from a GitHub-hosted CSV file.

AI-generated description

A program that creates a bar chart based on estimated UN Population levels in 2020.


Tutorials:


Extras:

  • Axis split into their own files
  • Animated bar generation when opening or refreshing the visualisation
  • Formatting
    • Bars made to look 3D & experimenting with filtering to give the bars depth
    • Bars formatted with alternating colors
    • Box shadowing on the background to give the chart depth
    • Title added in separate div (flexbox set up)
    • Bottom axis formatted as per this link

Other Documentation:

Comments

Sign in to join the discussion.

MIT Licensed