Skip to main content
Public

Share visualization

Loading preview…

CS573 Final Project - Average Sugar (g) Levels by Restaurant

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

CS573 Final Project - Average Sugar (g) Levels by Restaurant

1
Ppbruss@bu.edu
Last edited Nov 30, 2024
Created on Nov 15, 2024

This example shows a bar chart of average sugar levels (in grams) across six fast-food restaurant chains, using data from a Kaggle fast-food nutrition dataset. It uses D3.js version 7.8.5 with `scaleBand` and `scaleLinear` for positioning, and `d3.group` and `d3.mean` to aggregate the data. Hovering over a bar turns it black and displays a tooltip with the exact average value, while a responsive layout is handled by the `observeResize` and `axes` functions from external libraries.

AI-generated description

An interactive and responsive bar chart showing the average sugar by fast food restaurant. Includes a tooltip feature to view the exact values.

Dataset Source: https://www.kaggle.com/datasets/joebeachcapital/fast-food

Comments

Sign in to join the discussion.

MIT Licensed