Skip to main content
100%

Fork of Fork of Fork to pie chart

✓ Published0🌍 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.

MIT Licensed

Similar vizzes