mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 04:09:08 +02:00
a9dcf88378
Examples of the six charts that can be created, and the Chart.js library.
47 lines
730 B
HTML
47 lines
730 B
HTML
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<title>Doughnut Chart</title>
|
|
<script src="Chart.js"></script>
|
|
<meta name = "viewport" content = "initial-scale = 1, user-scalable = no">
|
|
<style>
|
|
canvas{
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<canvas id="canvas" height="450" width="450"></canvas>
|
|
|
|
|
|
<script>
|
|
|
|
var doughnutData = [
|
|
{
|
|
value: 30,
|
|
color:"#F7464A"
|
|
},
|
|
{
|
|
value : 50,
|
|
color : "#46BFBD"
|
|
},
|
|
{
|
|
value : 100,
|
|
color : "#FDB45C"
|
|
},
|
|
{
|
|
value : 40,
|
|
color : "#949FB1"
|
|
},
|
|
{
|
|
value : 120,
|
|
color : "#4D5360"
|
|
}
|
|
|
|
];
|
|
|
|
var myDoughnut = new Chart(document.getElementById("canvas").getContext("2d")).Doughnut(doughnutData);
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|