reactjs / react-chartjs

common react charting components using chart.js
MIT License
2.93k stars 301 forks source link

Canvas collapse with a display-none wrapper #36

Closed Huxpro closed 8 years ago

Huxpro commented 9 years ago

If the react-chart components is placed into a default display-none component, the canvas would be set to <canvas height="0"> .

Even if states change and a re-render triggered, the canvas re-calculate sizes but height still equal to 0 .So a error will be throw: Uncaught IndexSizeError: Failed to execute 'arc' on 'CanvasRenderingContext2D': The radius provided (-0.5) is negative.

I dont know which code deal with canvas size. the redraw props did not helps

Huxpro commented 9 years ago

Finally found it is a issue in ChartJS.

Here: https://github.com/nnnick/Chart.js/issues/1311