-
Notifications
You must be signed in to change notification settings - Fork 0
/
line.html
65 lines (57 loc) · 1.31 KB
/
line.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
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>Datatopie - Simple and lightweight vanillaJS charts</title>
<link rel="stylesheet" href="./dist/css/style.css">
</head>
<body>
<div class="graph_wrapper" data-graph="line" style="width:800px;height:400px;">
</div>
<!-- <script src="./dist/js/app.js"></script> -->
<script src="./dist/js/graph-lineV2.js"></script>
<script defer>
// TODO : Use proxies to update only the necessary parts when the data or the config change.
// let [header, datas] = _tableToJson(table)
const lineChart = {
"config": {
"mainTitle": "A very simple line chart about income",
"legendKey": "label",
"titleY": 'nombre',
"titleX": 'Date',
"wrapper": document.querySelector('[data-graph="line"]')
},
"data": [
{
"label": "02/06/2022",
"visitors": 5,
"views": 26
},
{
"label": "03/06/2022",
"visitors": 150,
"views": 234
},
{
"label": "04/06/2022",
"visitors": 15,
"views": 34
},
{
"label": "05/06/2022",
"visitors": 0,
"views": 0
},
{
"label": "06/06/2022",
"visitors": 300,
"views": 345
}
]
}
const graphLine = new GraphLine(lineChart.data, lineChart.config);
graphLine.init();
// graphLine.debug();
</script>
</body>
</html>