Skip to content

Regression from v2: max tick is sometimes omitted on the y-axis with log scale, no easy workaround #10644

@jberryman

Description

@jberryman

Expected behavior

In v2 when using a log scale and constraining the y-axis to the data min/max, we always see the max tick labeled (i.e. the very top of the graph). Like this:

v2

Current behavior

It seems like in v3 this is hit or miss (And I believe this inconsistency only happens for log scale):

v3

Attempting to add afterBuildTicks: axis => axis.ticks.push({"value": maxDataPoint}) for some graphs fixes the issue, for other graphs arbitrarily does not fix the issue, and for still other graphs makes things look terrible ( overlapping labels Etc).

The max is one of the most important data points for my data, so this is a big deal for me. any workaround is welcome

Reproducible sample

https://codepen.io/jberryman/pen/qBoeyYV

Optional extra steps/info to reproduce

No response

Possible solution

No response

Context

No response

chart.js version

v3.9.1

Browser name and version

chrome 103

Link to your project

No response

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