Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid error if borderOpts.dash is undefined #11907

Merged
merged 1 commit into from
Oct 13, 2024

Conversation

HieroglypH
Copy link
Contributor

@HieroglypH HieroglypH commented Sep 24, 2024

As the title suggests.

In my case,
I was implementing a radar chart and had set options.scales.r.border.dash to [3,3],
In certain environments, an error would occur and the chart would not display.

The error message is

Failed to execute 'setLineDash' on 'CanvasRenderingContext2D': The provided value cannot be converted to a sequence.

Reproduction rate is not 100%.
About 80% are displayed correctly with no errors.

I was never able to pinpoint the cause, but for some reason,
options.scales.r.border.dash seemed to become undefined internally.
Therefore, an error occurred in setLineDash in function drawRadiusLine and the process stopped.

At the very least, I tried to modify it so that the process would not stop due to an error.

@LeeLenaleee LeeLenaleee added this to the Version 4.5.0 milestone Sep 26, 2024
@LeeLenaleee LeeLenaleee requested a review from etimberg October 12, 2024 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants