Skip to content

Background color context element does not have position values #621

Description

@itayganor

Reproduction: https://codesandbox.io/s/chart-js-gradient-annotations-broken-8pf3z

It seems that on the first draw, ctx.element does not have x, x2, y nor y2, making it impossible to draw gradients.

These values are only missing on the first draw; You can uncomment line 52 and see that on the first draw green is returned, but after clicking "Force update", the actual gradient works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions