Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Question1_Answer1

Public visualization

Viewing a saved revision (read-only)

eb94058274ee44d1841b75999646a79a

Question1_Answer1

0 stars1🌍 Public
SSeema Shrestha
Last edited Apr 25, 2024
Created on Apr 25, 2024
Forked from Hello VizHub

This pie chart visualizes the distribution of drug types from a CSV dataset of 200 patients, showing the count of prescriptions for each drug. The chart uses D3 v7’s `d3.pie()` and `d3.arc()` to generate SVG arcs, with a categorical color scale (`d3.scaleOrdinal` with `d3.schemeCategory10`) for segment fills. Data is aggregated via `d3.group()`, and each slice includes a white value label. A legend on the right maps colors to drug names, rendered as SVG rectangles and text.

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.