Configuring your plots

danfo.js plotting uses Plotly.js as its backend for plotting. This means you have all the configuration, flexibility and interactiveness of Plotly.

All customization on the plot can be passed as an object of key-value pairs to the config parameter. For example, in the line plot below, we define a layout for our plot and give it a name.

For example in the following code, we show how to set some basic configuration as well as layout for a line plot.

<!doctype html>
<script src=""></script>
<script src="[email protected]/lib/bundle.min.js"></script>
<div id="mydiv"></div>
.then(df => {
var layout = {
title: {
text: "Time series plot of AAPL open and close points",
x: 0
legend: {
bgcolor: "#fcba03",
bordercolor: "#444",
borderwidth: 1,
font: { family: "Arial", size: 10, color: "#fff" }
width: 1000,
yaxis: {
title: 'AAPL open points',
xaxis: {
title: 'Date',
var config = {
columns: ["AAPL.Open", "AAPL.Close"], //columns to plot
displayModeBar: true,
modeBarButtonsToAdd: [{ //Add custom button
name: 'about',
icon: Plotly.Icons.question,
click: function (gd) {
alert('An example of configuring Danfojs Plots')
layout //layout object