Chart.js: Arc negative radius no rerender

Created on 10 Dec 2020  Â·  3Comments  Â·  Source: chartjs/Chart.js

In version 2 if the arc radius was negative it wouldn't render but as soon as it could because it was becoming positive it would render again. In version 3 this behaviour is not here anymore. Now when there is enough space to render the Arc (with a positive radius) it outputs a blank canvas.

Expected Behavior

When possible because radius would be positive again render the chart still

Current Behavior

Keep showing blank screen

Steps to Reproduce

Simple 2.9 example: https://jsfiddle.net/Leelenaleee/263mvt0n/6/
Simple 3.0.0-beta.7 example: https://jsfiddle.net/Leelenaleee/ng04jryt/23/

Context

In the vue app I am making I am using a chart to show data, it is possible to switch between chart types. Because something breaks hard when the arc cant be rendered even when I switch to different types it wont render, because in 2.9 it did rerender when it could again this was no issue

Environment

  • Chart.js version: 3.0.0-beta.7
  • Browser name and version: Chrome: 87.0.4280.66
  • Link to your project: Private
bug

Most helpful comment

Also mentioned here: https://github.com/chartjs/Chart.js/issues/8147#issuecomment-742390596

I think its best to fix the arc element to not draw when radius <= 0.

All 3 comments

Also mentioned here: https://github.com/chartjs/Chart.js/issues/8147#issuecomment-742390596

I think its best to fix the arc element to not draw when radius <= 0.

The stack trace from 8147 is different than the one here. This one is in the arc element, while 8147 is in the radial scale. We should make sure to fix both.

The stack trace from 8147 is different than the one here. This one is in the arc element, while 8147 is in the radial scale. We should make sure to fix both.

I created a separate issue for the scale: #8169

Was this page helpful?
0 / 5 - 0 ratings