Skip to main content
Public

Share visualization

Loading preview…

ICE-6 Bar chart SDV

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

ICE-6 Bar chart SDV

0
Ssreeramyamini@gmail.com
Last edited Mar 20, 2024
Created on Mar 20, 2024

This bar chart displays the distribution of calories across different cereal brands, with each bar representing a specific cereal’s calorie count. The visualization uses D3.js v7 to load CSV data from a GitHub gist, parse the numeric calorie values, and render the chart as SVG. The code employs `d3.scaleBand` for the categorical x-axis and `d3.scaleLinear` for the continuous y-axis, with axes formatted via `d3.axisBottom` and `d3.axisLeft`. Cereal names on the x-axis are rotated for readability, while bar heights encode the calorie values directly. The chart’s layout and margins are defined programmatically, and error handling logs any data-loading issues.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed