Skip to content

A 0px legend border becomes .5px instead #3241

@Pikamander2

Description

@Pikamander2

chartjs bug

If you try to set the legend's border to 0px, it becomes .5px instead. This causes a faint border to appear around the legend's color, which is undesirable.

Making the label's color value fully transparent ("rgba(0,0,0,0)") fixes this in Chrome, but not Firefox.

Here's an example: http://codepen.io/anon/pen/GjRKLX

Here's that example, scaled 3x to make it more obvious: http://codepen.io/anon/pen/yaLBky

The reason why this occurs is because, when setting canvas's lineWidth property, "zero, negative, Infinity and NaN values are ignored" and instead replaced with a value of 0.5.

To avoid this problem, Chart.js shouldn't draw the border if the borderWidth is set to 0.

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