Spaces:
Running
Running
| <html> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width" /> | |
| <title>My Danfo.js Space</title> | |
| <script src="https://cdn.jsdelivr.net/npm/danfojs@1.0.0/lib/bundle.js"></script> | |
| </head> | |
| <body> | |
| <div id="plot_div"></div> | |
| <script> | |
| dfd.readCSV( | |
| "https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv" | |
| ) | |
| .then((df) => { | |
| let layout = { | |
| title: "A financial charts", | |
| xaxis: { | |
| title: "Date", | |
| }, | |
| yaxis: { | |
| title: "Count", | |
| }, | |
| }; | |
| let config = { | |
| columns: ["AAPL.Open", "AAPL.High"], | |
| }; | |
| let new_df = df.setIndex({ column: "Date" }); | |
| new_df.plot("plot_div").line({ config, layout }); | |
| }) | |
| .catch((err) => { | |
| console.log(err); | |
| }); | |
| </script> | |
| </body> | |
| </html> | |