-
Notifications
You must be signed in to change notification settings - Fork 0
/
chart2.html
32 lines (29 loc) · 869 Bytes
/
chart2.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
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
<link href="https://fonts.googleapis.com/css?family=ZCOOL+KuaiLe&display=swap" rel="stylesheet">
</head>
<body>
<div style="width: 800px; height: 600px; display: inline-block;">
<svg class="bar-chart"></svg>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.xkcd.min.js"></script>
<script>
const svg = document.querySelector('.bar-chart')
const barChart = new chartXkcd.Bar(svg, {
title: 'Contrbiutors with a documentation problem', // optional
// xLabel: '', // optional
yLabel: 'percentage of contributors', // optional
data: {
labels: ['have a problem', 'actually contribute'],
datasets: [{
data: [93, 40],
}],
},
options: { // optional
yTickCount: 4,
},
});
</script>
</div>
</body>
</html>