Skip to content

TypeError: lineCap must be a string #938

@mlohbihler

Description

@mlohbihler

I am using chart.js in node and using 'skia-canvas' to raise windows and provide a canvas / graphics context. This context appears to be pickier about lineCap and lineJoin properties, which cannot be set to undefined or null. Happily this problem is easily fixed by adding their 'annotation' equivalents (i.e. borderCapStyle, and borderJoinStyle) to the default options of certain structures. So far i have only encountered the errors with LineAnnotation.defaults and arrowHeadsDefaults. Adding the following lines to each is the fix:

  borderCapStyle: 'butt',
  borderJoinStyle: 'miter',

I can create a PR for this if that is easier, but i noted that there are currently 12 outstanding PRs already, some going back years.

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