Skip to content

fit() does not take scaleExtent() into account when changing scale #463

@obraud

Description

@obraud

Describe the bug
Using fit() may actually zoom in or out more than initially allowed by scaleExtent() (e.g. [0.001, 1] may actually result in a final scale of 1.5 on a small chart).
When zooming in/out afterwards, the scale will actually bump back to max/min scale.

To Reproduce
Example repo with scaleExtent set to 1

  • click Fit to the screen => chart is zoomed out
  • zoom out => chart is zoomed in back to scale 1

Expected behavior
fit() should use scaleExtent() min/max values when setting scale, or maybe provide an option to match scaleExtent?

Desktop (please complete the following information):

  • OS: Windows
  • Browser: Firefox
  • Version: 3.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions