Radial scale fails when radius is negative
See original GitHub issue
ctx.beginPath();
if (circular) {
ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU); <--- ERROR radius = -39
} else {
pointPosition = scale.getPointPosition(0, radius);
ctx.moveTo(pointPosition.x, pointPosition.y);
for (let i = 1; i < valueCount; i++) {
pointPosition = scale.getPointPosition(i, radius);
ctx.lineTo(pointPosition.x, pointPosition.y);
}
}
Uncaught DOMException: Failed to execute 'arc' on 'CanvasRenderingContext2D': The radius provided (-39) is negative.
at drawRadiusLine (http://testserver.home:8123/hacsfiles/chart-card/chart.js?module:11228:7)
at http://testserver.home:8123/hacsfiles/chart-card/chart.js?module:11371:6
at Array.forEach (<anonymous>)
at RadialLinearScale.drawGrid (http://testserver.home:8123/hacsfiles/chart-card/chart.js?module:11368:13)
at RadialLinearScale.draw (http://testserver.home:8123/hacsfiles/chart-card/chart.js?module:4882:6)
at Object.draw (http://testserver.home:8123/hacsfiles/chart-card/chart.js?module:4895:9)
at Chart.draw (http://testserver.home:8123/hacsfiles/chart-card/chart.js?module:5750:14)
at Chart.render (http://testserver.home:8123/hacsfiles/chart-card/chart.js?module:5729:7)
at Chart.update (http://testserver.home:8123/hacsfiles/chart-card/chart.js?module:5677:6)
at Chart._resize (http://testserver.home:8123/hacsfiles/chart-card/chart.js?module:5489:7)
drawRadiusLine @ chart.js?module:11228
(anonymous) @ chart.js?module:11371
drawGrid @ chart.js?module:11368
draw @ chart.js?module:4882
draw @ chart.js?module:4895
draw @ chart.js?module:5750
render @ chart.js?module:5729
update @ chart.js?module:5677
_resize @ chart.js?module:5489
resize @ chart.js?module:5463
listener @ chart.js?module:5938
(anonymous) @ chart.js?module:1710
(anonymous) @ chart.js?module:34
(anonymous) @ chunk.af43f6ec356055cbfe65.js:1
requestAnimationFrame (async)
window.requestAnimationFrame @ chunk.af43f6ec356055cbfe65.js:1
(anonymous) @ chart.js?module:32
(anonymous) @ chart.js?module:1722
_Originally posted by @zibous in https://github.com/chartjs/Chart.js/issues/8147#issuecomment-742390596_
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Can the radius of a circle be negative? - Quora
No. Radius is a distance, and as we know that in the 2 or 3 dimensions there cant be a distance that goes...
Read more >Arc negative radius no rerender #8150 - chartjs/Chart.js - GitHub
In version 2 if the arc radius was negative it wouldn't render but as soon as it could because it was becoming positive...
Read more >Negative strength of radial force component not work on ...
I have radial force component in my project with negative strength, which I use to simulate gravity(force strength set to -50000.0).
Read more >Consequences of calibration errors. (a) Radial error r e from a...
Consequences of calibration errors. (a) Radial error r e from a positive (solid) and negative (dashed) X-axis offset as a function of zenithal...
Read more >Radial and Angular Parts of Atomic Orbitals
When the orbitals overlap so that the wave functions match positive to negative, the bond will be weaker or may not form at...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think this got fixed in #8191
Hello @etimberg , I just ended a PR for the radius validation, let me know if there’s something wrong or if it needs another thing