Skip to content

Uneven tick spacing with maxTicksLimit and min options with Chart.js 3 #8806

Description

@ankane

Hey, congrats on the 3.0 release! Came across a possible issue with the interaction of the maxTicksLimit and min options.

Expected Behavior

Even tick spacing (like in Chart.js 2)

Current Behavior

Uneven tick spacing

Steps to Reproduce

https://codepen.io/ankane/pen/LYxyXEN

There's even spacing when the min option is removed (and has the same min value in the example). There's also even spacing if maxTicksLimit is increased by one in the example (and has less than maxTicksLimit ticks).

Noticed this with both bar and line charts.

Context

Ran into this trying to upgrade Chartkick to Chart.js 3

Environment

  • Chart.js version: 3.0.1
  • Browser name and version: Firefox 87.0

Edit: Also, it's probably on your list, but the Codepen in the new issue template could use upgrading to Chart.js 3

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions