jlelse
/
kis3
Archived
1
Fork 0
This repository has been archived on 2021-01-04. You can view files and clone it, but cannot push or open issues or pull requests.
kis3/static/chart.html

52 lines
1.3 KiB
HTML

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>KISSS</title>
<script>{{ .ChartJS }}</script>
<style>
canvas {
-moz-user-select: none;
-webkit-user-select: none;
-ms-user-select: none;
}
</style>
</head>
<body>
<div id="container" style="width: 100%;">
<canvas id="canvas"></canvas>
</div>
<script>
window.onload = function () {
window.myBar = new Chart(document.getElementById('canvas').getContext('2d'), {
type: 'horizontalBar',
data: {
labels: {{ .Labels }},
datasets: [{
backgroundColor: 'rgba(30,144,255, 0.5)',
borderColor: 'rgba(30,144,255)',
data: {{ .Values }}
}]
},
options: {
responsive: true,
legend: {
display: false
},
scales: {
xAxes: [{
ticks: {
min: 0,
precision: 0
}
}],
}
}
});
};
</script>
</body>
</html>