Spaces:
Running
Running
Commit
·
4c4526f
1
Parent(s):
f1cd4d1
Update index.html
Browse files- index.html +31 -15
index.html
CHANGED
@@ -3,22 +3,38 @@
|
|
3 |
<head>
|
4 |
<meta charset="utf-8" />
|
5 |
<meta name="viewport" content="width=device-width" />
|
6 |
-
<title>My
|
7 |
-
<
|
8 |
</head>
|
9 |
<body>
|
10 |
-
<div
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
</body>
|
24 |
</html>
|
|
|
3 |
<head>
|
4 |
<meta charset="utf-8" />
|
5 |
<meta name="viewport" content="width=device-width" />
|
6 |
+
<title>My Danfo.js Space</title>
|
7 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/bundle.js"></script>
|
8 |
</head>
|
9 |
<body>
|
10 |
+
<div id="plot_div"></div>
|
11 |
+
<script>
|
12 |
+
|
13 |
+
dfd.readCSV(
|
14 |
+
"https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv"
|
15 |
+
)
|
16 |
+
.then((df) => {
|
17 |
+
let layout = {
|
18 |
+
title: "A financial charts",
|
19 |
+
xaxis: {
|
20 |
+
title: "Date",
|
21 |
+
},
|
22 |
+
yaxis: {
|
23 |
+
title: "Count",
|
24 |
+
},
|
25 |
+
};
|
26 |
+
|
27 |
+
let config = {
|
28 |
+
columns: ["AAPL.Open", "AAPL.High"],
|
29 |
+
};
|
30 |
+
|
31 |
+
let new_df = df.setIndex({ column: "Date" });
|
32 |
+
new_df.plot("plot_div").line({ config, layout });
|
33 |
+
})
|
34 |
+
.catch((err) => {
|
35 |
+
console.log(err);
|
36 |
+
});
|
37 |
+
|
38 |
+
</script>
|
39 |
</body>
|
40 |
</html>
|