Creating line charts with Danfo.js
Line charts are simple chart types mostly used on Series data or single columns. They can show trends in data points. To make a line chart on a single column – say, AAPL.Open
in financial_df
– we can do the following:
var layout = { Â Â Â Â yaxis: { Â Â Â Â Â Â title: 'AAPL open points', Â Â Â Â } } var config = { Â Â displayModeBar: false, Â Â layout } financial_df ['AAPL.Open'].plot(this_div()).line(config)
Running the preceding code gives the following output:
Notice that we are using DataFrame subsetting (financial_df["column name"]
) to get a single column – AAPl.Open
– as a Series. Then, we call the .line
chart type and pass in a config
object. The config
object accepts the layout
property as well as other arguments used by Danfo.js...