-
Notifications
You must be signed in to change notification settings - Fork 7
/
back.html
50 lines (46 loc) · 1.48 KB
/
back.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
<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: 'line',
data: {
labels: ["Red", "Blue", "Yellow", "Green", "Purple", "Orange"],
datasets: [{
label: '# of Votes',
data: [12, 19, 3, 5, 2, 3]
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero:true
}
}]
},
watermark: {
image: image,
alignY: "bottom",
position: "back",
}
}
});
</script>
</body>
</html>