Skip to content

[BUG]: Trace doesn't line up with axis when having an automargin title and there are sliders/buttons displayed #7750

Closed

Description

@e-drakos

Description

There is an issue with the title's automargin feature when a slider or buttons are displayed. In this case, when automargin increases the top margin, it will push down the chart’s tick labels (correctly) but will NOT push down the traces. Then, the trace is in the wrong location on the y-axis and misrepresents the data values.

Screenshots/Video

Image

Steps to reproduce

Notes

This seems to be a combination of margin:{autoexpand:true}, title:{automargin:true} and having sliders and/or buttons displayed. You can also set a bigger title font (like font:{size:"36"}) for this to have a greater effect.

Activity

  1. emilykl commented on Apr 16, 2026

    @emilykl
    Contributor

    Thanks for the report, @e-drakos! This is definitely a bug.

    I'm able to reproduce with adding just margin: {t: 0}, title: {automargin: true, text:"Title"}

    so I suspect we may not be properly handling the case where title automargin is set to true but the top margin is explicitly set to 0, specifically when buttons/sliders are present.

  2. gokul-debugger commented on Aug 11, 2026

    @gokul-debugger
    Contributor

    Hi, I’d like to work on this. I’ve reviewed the report and the current automargin flow for titles, sliders, and update menus. I’ll start with a focused regression test, then fix the margin calculation so the axes and traces remain aligned. May I take this one?

  3. camdecoster commented on Aug 11, 2026

    @camdecoster
    Contributor

    @gokul-debugger go for it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions