-
Notifications
You must be signed in to change notification settings - Fork 1
/
01_PiePeopleWithCats.html
51 lines (46 loc) · 1.72 KB
/
01_PiePeopleWithCats.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
43
44
45
46
47
48
49
50
51
<html>
<head>
<title>Люди с котами и без - ChartJS (http://chartjs.devexpress.com)</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type='text/javascript' src='http://code.jquery.com/jquery-1.9.1.js'></script>
<script type='text/javascript' src="http://ajax.aspnetcdn.com/ajax/globalize/0.1.1/globalize.min.js"></script>
<script type='text/javascript' src="http://cdn3.devexpress.com/jslib/13.1.5/js/dx.chartjs.js"></script>
</head>
<body>
<style>
</style>
<!-- Markup -->
<div id="chartContainer" style="width:100%;height: 600px"></div>
<!-- Script -->
<script>
var dataSource = [
{ category: "Не держат<br/>кошек", number: 172 },
{ category: "Хотят завести<br/>кошку", number: 21 },
{ category: "Держат<br/>кошку", number: 40 },
{ category: "Держат две<br/>кошки", number: 8 }
];
$("#chartContainer").dxPieChart({
dataSource: dataSource,
series: {
type: "donut",
argumentField: "category",
valueField: "number",
innerRadius: 0.5,
hoverMode: "none"
},
legend: {
verticalAlignment: "bottom",
horizontalAlignment: "center",
equalColumnWidth: true
},
tooltip: {
enabled: true,
customizeText: function () {
return this.argumentText + "<br/>"
+ this.percentText + " (" + this.valueText + ")";
}
}
});
</script>
</body>
</html>