forked from code4fukui/chart-bar
-
Notifications
You must be signed in to change notification settings - Fork 1
/
script.html
57 lines (52 loc) · 987 Bytes
/
script.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
51
52
53
54
55
56
57
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width">
<title>chart-bar demo</title>
</head>
<body style="text-align:center">
<h1>chart-bar tag demo by script</h1>
<div id=p></div>
<script type="module">
import { ChartBar } from "./chart-bar.js";
const data = {
"A": 30,
"B": 20,
"C": 70,
};
const chart = new ChartBar(data);
p.appendChild(chart);
const data2 = [
{
"A": 30,
"B": 120,
"C": 70
},
{
"test1": {
"A": 3,
"B": 2,
"C": 7
}
},
{
"test2": {
"A": 30,
"B": 20,
"C": 70
}
},
{
"test3": {
"A": 30,
"B": 20,
"C": 70
}
}
];
const chart2 = new ChartBar(data2, {
width: window.innerWidth - 50,
height: 300,
orientation: "v"
});
p.appendChild(chart2);
</script>
</body>
</html>