Text and Font Styling in

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


Plotly is known for its graphing libraries, but it's also a broader ecosystem for building interactive data apps, AI data analysis tools, and deploying and hosting Dash apps. Explore the full set of tools and platforms designed to help turn data into action. Discover Plotly.

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: {
    text: 'Global Font'
  },
  font: {
    family: 'Courier New, monospace',
    size: 18,
    color: '#7f7f7f'
  }
};
Plotly.newPlot('myDiv', data, layout);