-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
[ Polar Chart inside bootstrap's Tabs] Failed to execute 'arc' on 'CanvasRenderingContext2D': The radius provided (-190) is negative. #4119
Comments
I believe this is fixed in later versions. Can you try version 2.5.0? |
Thanks for checking @sandip-stats. Is it possible to drop this in a fiddle so we can debug? |
Hello @etimberg
TO
the chart works. Do note this is just a mock up; so that the issue can be showcased. In my code the data is being fetched via an ajax call. Regards, |
This is nothing bootstrap specific. See this fiddle https://jsfiddle.net/L7k6Lxfb/ If the display style of the container around the canvas is "none" or "inline" the exception is thrown. So you can't initialize a polar chart in a "collapsed" area :/ |
I think this is the same issue as #4397 which is already fixed |
Using Chart.js the latest version 2.7.2.
|
Seeing the following issue when using Polar Charts inside bootstrap tabs.
Scripts used along with their versions:
jquery.js - 2.2.1 version
Chart.bundle.min.js - 2.1.5 version
bootstrap.min.js - 3.3.7 version
Have 3 tabs - 1st & 2nd tab contains bar charts, 3rd has the polar chart
Do note that the data is fetched via Ajax call to the server.
Here is the Stack:-
Uncaught DOMException: Failed to execute 'arc' on 'CanvasRenderingContext2D': The radius provided (-190) is negative.
at https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.5/Chart.bundle.min.js:15:16979
at Object.r.each (https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.5/Chart.bundle.min.js:13:18227)
at n.draw (https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.5/Chart.bundle.min.js:15:16701)
at t.Controller. (https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.5/Chart.bundle.min.js:13:10032)
at Object.r.each (https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.5/Chart.bundle.min.js:13:18227)
at t.Controller.draw (https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.5/Chart.bundle.min.js:13:10005)
at n.o.render (https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.5/Chart.bundle.min.js:13:9704)
at Object.startDigest (https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.5/Chart.bundle.min.js:13:5255)
at https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.5/Chart.bundle.min.js:13:4724
A resize of window is required to render the graphs.
Strange thing being if i move the polar chart to the 1st tab, all works fine.
My JS looks like the following:
Am i missing something or doing anything incorrectly?
Any help would be really appreciated.
Regards,
Sandip
The text was updated successfully, but these errors were encountered: