Skip to content

Axis automarging does not work #334

Open
@MinnML

Description

@MinnML

Hello,
I cannot get the Plotly.js automargin feature to work in React for axis ticks and labels.

Here is an example using official example:

// ...
var data = [
  {
    x: ['Apples', 'Oranges', 'Watermelon', 'Pears'],
    y: [3, 2, 1, 4],
    type: 'bar'
  }
];
var layout = {
  autosize: false,
  width: 500,
  height: 500,
  yaxis: {
    title: 'Y-axis Title',
    ticktext: ['long label','Very long label','3','label'],
    tickvals: [1, 2, 3, 4],
    tickmode: 'array',
    automargin: true,
    titlefont: { size:20 },
  },
};

  return (
    <div className="card-page">
        <Plot data={data} layout={layout}></Plot>
   </div>

What I get is this:
newplot

Am I missing a setting?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions