forked from tradingview/lightweight-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
debug.html.example
44 lines (34 loc) · 991 Bytes
/
debug.html.example
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0">
<title>Debug page</title>
<script type="text/javascript" src="./dist/lightweight-charts.standalone.development.js"></script>
</head>
<body style="padding: 0; margin: 0;">
<div id="container" style="position: absolute; width: 100%; height: 100%;"></div>
<script type="text/javascript">
function generateData() {
var res = [];
var time = new Date(Date.UTC(2018, 0, 1, 0, 0, 0, 0));
for (var i = 0; i < 500; ++i) {
res.push({
time: time.getTime() / 1000,
value: i,
});
time.setUTCDate(time.getUTCDate() + 1);
}
return res;
}
var chart = LightweightCharts.createChart(document.getElementById('container'));
var mainSeries = chart.addLineSeries({
priceFormat: {
minMove: 1,
precision: 0,
},
});
mainSeries.setData(generateData());
</script>
</body>
</html>