-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpercentage_position.html
48 lines (45 loc) · 1.46 KB
/
percentage_position.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
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.umd.min.js"></script>
<script src="../chartjs-plugin-watermark.js"></script>
<style type="text/css">
#myChart {
max-width: 600px;
max-height: 400px;
}
</style>
</head>
<body>
<div class="myChartDiv">
<canvas id="myChart" width="600" height="400"></canvas>
</div>
<script type="text/javascript">
var ctx = document.getElementById("myChart");
var image = new Image();
image.src = "https://placekitten.com/200/300";
var myChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3],
borderWidth: 1
}]
},
options: {
scales: {
y: {
beginAtZero: true
}
},
watermark: {
image: image,
x: "50%",
y: "25%",
}
}
});
</script>
</body>
</html>