Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

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

Open jberryman opened this issue 3 years ago • 3 comments

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

jberryman avatar Aug 30 '22 16:08 jberryman

This is likely fixed in the upcomming V4 release with the inclusion of this pr: #9166 https://codepen.io/leelenaleee/pen/eYMqPyo

LeeLenaleee avatar Aug 30 '22 17:08 LeeLenaleee

seems to be, thanks! (aside: is a v4 release scheduled? is there a way to see current migration guide?)

jberryman avatar Aug 30 '22 18:08 jberryman

No there is no release date scheduled yet since it fully depends on how much time we have to work on the issues we want to have included.

Current migration guide to V4 can be found here already: https://www.chartjs.org/docs/master/migration/v4-migration.html

LeeLenaleee avatar Aug 30 '22 18:08 LeeLenaleee

Closing as this is fixed in V4

LeeLenaleee avatar Sep 27 '22 21:09 LeeLenaleee