-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbit-graph.html
More file actions
51 lines (45 loc) · 1.13 KB
/
bit-graph.html
File metadata and controls
51 lines (45 loc) · 1.13 KB
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
<html>
<head>
<title>Bit-graph Demo</title>
</head>
<body>
<!-- Template to load -->
<script type="text/stache" id="demo-html" can-autorender>
<can-import from="bit-graph" />
<h1>De-Normalized Data</h1>
<bit-graph width="500" height="300">
<bit-series data="{data1}" />
<bit-series data="{data2}" color="#F00" />
</bit-graph>
<h1>Normalized Data</h1>
<bit-graph normalize width="500" height="300">
<bit-series data="{data1}" />
<bit-series data="{data2}" color="#F00" />
</bit-graph>
</script>
<!-- Loading Script -->
<script src="node_modules/steal/steal.js" id="demo-source" main="can/view/autorender/">
import $ from "jquery";
import can from "can";
var seriesData = new can.List([
1, 2, 3, 4, 5, 3, 1, 3, 5
]);
var anotherSeries = new can.List([
"3", "6", "2", "5"
]);
var vm = $("#demo-html").viewModel();
vm.attr({
data1: seriesData,
data2: anotherSeries
});
anotherSeries.push(0);
window.setInterval(() => {
var val = Math.floor(Math.random() * 10) + 1;
can.batch.start();
console.log('pushing', val);
anotherSeries.push(val);
can.batch.stop();
}, 8000);
</script>
</body>
</html>