Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork of Fork of Fork to pie chart

Public visualization

Viewing a saved revision (read-only)

9dc2a3b8b92743e4a7cb4d6220d15120

Fork of Fork of Fork to pie chart

0 stars0🌍 Public
Rramsrinivaskatragadda@my.unt.edu
Last edited Apr 13, 2024
Created on Apr 13, 2024

This example displays total sales by category as a pie chart, with categories drawn from a CSV file and sales values pulled from a specific column. The chart is rendered on an HTML canvas using the Chart.js library, initiated with `new Chart(ctx, { type: 'pie', ... })`. Data is fetched asynchronously via `fetch()` from a GitHub Gist, then parsed by splitting rows and columns. Random hex colors are generated for each slice using `Math.floor(Math.random() * 16777215).toString(16)`, and percentage labels are computed within the `datalabels` plugin formatter.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.