Skip to content

Bug with repeated labels as strings? #2994

@dibsyjr

Description

@dibsyjr

Hi,

I've recently upgraded to version 2.2.0 rc and it's broken some of my existing code, don't know if this is a bug or not but I've sussed that this only happens when there are repeated string labels (have tried with repeated integers as labels and it worked perfectly).

chartjsstringlabelbug

As you can see it will display any strings that aren't repeated labels in the correct position but otherwise it'll just write the new label over the existing one, making it darker. I am using a custom scale that I wrote myself but this doesn't affect the labels at all, it merely gives a wider/darker line for the start of a day. The problem seems to be coming from the positions given for the x labels/ticks. Haven't found a solution yet but will keep looking.

Note that this only seems to occur with an array that contains repeated strings and doesn't with an array of integers i.e. ["1", "2", "3", "1", "2", "3", "1", "2", "3"] will draw 9 labels on top of 3 points (the first three) but [1, 2, 3, 1, 2, 3, 1, 2, 3] will draw 9 different labels on 9 different points.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions