-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
55 lines (49 loc) · 1.98 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="icon" href="favicon.ico" />
<meta charset="utf-8" />
<script type="text/javascript" src="labeledData.js"></script>
<script type="text/javascript" src="lightweight-charts.standalone.production.js"></script>
<title>Vraid Systems Ltd. - ml_timeseries_predictions</title>
</head>
<body>
<script type="text/javascript">
const firstElementIndex = 0
const lastElementIndex = labeledData.length - 1
const dataLabels = Object.keys(labeledData[firstElementIndex][1]).concat(Object.keys(labeledData[lastElementIndex][1]))
const viewHeight = Math.floor(Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0) * 0.98)
const viewWidth = Math.floor(Math.max(document.documentElement.clientWidth || 0, window.innerWidth || 0) * 0.98)
const chart = LightweightCharts.createChart(document.body, {
height: viewHeight,
leftPriceScale: {
visible: true,
},
rightPriceScale:{
visible: false,
},
timeScale: {
secondsVisible: true,
timeVisible: true,
},
width: viewWidth,
})
for (let labelIndex = 0; labelIndex < dataLabels.length; labelIndex += 1) {
const chartSeries = chart.addLineSeries({
title: dataLabels[labelIndex],
})
const formattedLineSeriesData = []
for (let labeledDataIndex = 0; labeledDataIndex < labeledData.length; labeledDataIndex += 1) {
formattedLineSeriesData.push({
time: (new Date(labeledData[labeledDataIndex][0])).getTime() / 1000,
value: labeledData[labeledDataIndex][1][dataLabels[labelIndex]],
})
}
chartSeries.setData(formattedLineSeriesData)
}
</script>
<br />
Powered by <a href="https://github.com/tradingview/lightweight-charts">lightweight-charts</a>
created by and copyright of <a href="https://www.tradingview.com/">TradingView</a>.
</body>
</html>