Skip to main content
Public

Share visualization

Loading preview…

Assignment 2_Bubble 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

Assignment 2_Bubble chart

0
Cchsaisriharsha@gmail.com
Last edited Jul 22, 2023
Created on Jul 22, 2023

This bubble chart visualizes the correlation between make cost, selling price, and profit percentage for various car brands. The data, sourced from `profits.csv`, is rendered as an interactive SVG using D3 v7, where bubble size encodes profit percentage and color distinguishes car brands. Implemented with `d3.csv`, `d3.scaleLinear`, and `d3.scaleOrdinal`, the chart displays axes for selling price and cost, with a legend for profit percentage and brand colors. Hovering over a bubble triggers a tooltip showing the brand name, supported by custom `showTooltip`, `moveTooltip`, and `hideTooltip` functions on `mouseover`, `mousemove`, and `mouseleave` events.

AI-generated description

An example showing the capabilities of VizHub:

  • Loads D3 via UNPKG.
  • Demonstrates use of import from "d3".
  • Demonstrates use of import from local ES6 modules.

Comments

Sign in to join the discussion.

MIT Licensed