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)

6c0298ab1f4c475499c4222baf3c7e63

Fork of Fork of Fork to pie chart

0 stars0🌍 Public
TTarun Kumar Bosupally
Last edited Mar 28, 2024
Created on Mar 28, 2024

This example visualizes cereal ratings as a pie chart using the Chart.js library, rendering each cereal’s rating as a slice on an HTML canvas. It fetches a CSV dataset from a GitHub gist, parses the rows to extract cereal names and their rating values, then feeds those into the chart with a custom color palette. The chart is configured to be responsive while maintaining a fixed aspect ratio, and it displays a title above the visualization. The code explicitly uses the `Chart` constructor with the `type: 'pie'` option, along with canvas 2D context, to draw the final output.

AI-generated description

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

See also React Starter.