-
-
Notifications
You must be signed in to change notification settings - Fork 22
/
default_esm.html
47 lines (46 loc) · 1.31 KB
/
default_esm.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
<!DOCTYPE html>
<html>
<head>
<title>Box Plot Chart</title>
</head>
<body>
<div id="container" style="width: 75%">
<canvas id="canvas"></canvas>
</div>
<script defer src="https://unpkg.com/es-module-shims"></script>
<script type="importmap-shim">
{
"imports": {
"chart.js": "https://unpkg.com/chart.js@3.8.0?module",
"chart.js/helpers": "https://unpkg.com/chart.js@3.8.0/helpers/helpers.esm.js?module",
"@sgratzl/boxplots": "https://unpkg.com/@sgratzl/boxplots?module",
"@sgratzl/chartjs-chart-boxplot": "../build/index.js"
}
}
</script>
<script type="module-shim">
import { BoxPlotChart } from '@sgratzl/chartjs-chart-boxplot';
const chart = new BoxPlotChart(document.getElementById('canvas'), {
data: {
labels: ['A', 'B', 'C'],
datasets: [{
label: 'Test',
data: [
Array(100).fill(0).map(() => Math.random())
]
}, {
label: 'Test',
data: [
Array(100).fill(0).map(() => Math.random())
]
}, {
label: 'Test',
data: [
Array(100).fill(0).map(() => Math.random())
]
}]
}
})
</script>
</body>
</html>