plotly.js

The open source JavaScript graphing library that powers Plotly

Show Sidebar Hide Sidebar
Plotly.js

Text and Font Styling in plotly.js

How to edit and style the font of D3.js-based graphs in javascript.

var data = [
  {
    x: [0, 1, 2, 3, 4, 5, 6, 7, 8],
    y: [0, 1, 2, 3, 4, 5, 6, 7, 8],
    type: 'scatter'
  }
];
var layout = {
  title: 'Global Font',
  font: {
    family: 'Courier New, monospace',
    size: 18,
    color: '#7f7f7f'
  }
};
Plotly.newPlot('myDiv', data, layout);

plotly.js runs on all SVG-compatible browsers

Still need help?
Contact Us

For guaranteed 24 hour response turnarounds, upgrade to a Developer Support Plan.