forked from yusufshakeel/chartjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
42 lines (40 loc) · 831 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html>
<head>
<title>ChartJS - Pie Chart</title>
<script src="jquery-2.1.4.min.js"></script>
<script src="Chart.js"></script>
</head>
<body>
<canvas id="mycanvas" width="256" height="256">
<script>
$(document).ready(function(){
var ctx = $("#mycanvas").get(0).getContext("2d");
//pie chart data
//sum of values = 360
var data = [
{
value: 270,
color: "cornflowerblue",
highlight: "lightskyblue",
label: "Corn Flower Blue"
},
{
value: 50,
color: "lightgreen",
highlight: "yellowgreen",
label: "Lightgreen"
},
{
value: 40,
color: "orange",
highlight: "darkorange",
label: "Orange"
}
];
//draw
var piechart = new Chart(ctx).Pie(data);
});
</script>
</body>
</html>