Chart.js: Overlapping Y-axis labels

Created on 17 Jan 2018  ·  8Comments  ·  Source: chartjs/Chart.js

I have this Y-axis object:

{
    id: 'events',
    type: 'category',
    labels: this.state.eventLabelArray),
    scaleLabel: {
        display: true,
        labelString: 'Phenology'
    },
    ticks: {
        autoSkip: true
    }
}

Despite autoSkip being declared as "true," it's not working-each label is rendered, none are skipped:

image

If I de-duplicate the labels, the data is no longer mapped in the tooltip:

{
    id: 'events',
    type: 'category',
    labels: Array.from([...new Set(this.state.eventLabelArray)]),
    scaleLabel: {
        display: true,
        labelString: 'Phenology'
    },
    ticks: {
        autoSkip: true
    }
}

image

duplicate bug

Most helpful comment

i also got this issue if i set a custom min/max value in the ticks object and the min/max value is only a little bit above/under the auto labeled values

All 8 comments

I believe the issue here is that the label auto skipper is not implemented for vertical axes. I think another ticket already covers this but I can't find it

i also got this issue if i set a custom min/max value in the ticks object and the min/max value is only a little bit above/under the auto labeled values

I'm pretty sure the auto skipper is implemented for vertical axes: https://github.com/chartjs/Chart.js/blob/32aeeac82cdc371b6eb15e0b3442d307e2f36df7/src/core/core.scale.js#L629. But it sounds like maybe there's a bug where it's not working correctly

auto skipper is enabled for vertical in master only (PR #5922), so probably fixed.

is there a date for the next release?

TBD. I think we'd like to get a number of pending PRs merged first

Was this resolved?

Going to call this resolved since 2.9 shipped with these changes

Was this page helpful?
0 / 5 - 0 ratings