Setting up Danfo.js for plotting
By default, Danfo.js provides some basic chart types. These charts can be called on any DataFrame or Series object and, if the correct arguments are passed, it will display the corresponding chart.
At the time of writing, Danfo.js comes with the following charts:
- Line charts
- Box and violin plots
- Tables
- Pie charts
- Scatter plots
- Bar charts
- Histograms
These charts are exposed via the plot
function. That is, if you have a DataFrame or Series object, calling the plot
function on them exposes these charts.
The plot
method requires a div
ID where the plot is to be shown. For example, assuming df
is a DataFrame, we can call the plot
function as shown in the following code snippet:
const df = new DataFrame({...}) df.plot("my_div_id").<chart type>
The chart type can be line
, bar
, scatter
, hist
, pie
, box
, violin
, or table
. Â
Each plot type will accept plot-specific arguments, but...