ankane / react-chartkick

Create beautiful JavaScript charts with one line of React
https://chartkick.com/react
MIT License
1.2k stars 58 forks source link

"Loading text" isn't being removed #12

Closed Sexual closed 6 years ago

Sexual commented 6 years ago

For whatever reason when using Highcharts and react-chartkick, the chart is loaded but the "Loading..." text remains causing the graph to be pushed out of the parent element.

2e0cksd0tteu1z7zpmq4ia

ankane commented 6 years ago

Hey, thanks for reporting. Do you have two charts with the same id by any chance?

Sexual commented 6 years ago

Nope, only got one chart. Even tried adding a completely random ID.

Sexual commented 6 years ago

I've actually experimented a bit more, this looks like an issue with the chart trying to render an empty object/array before the content has been fetched and then for whatever reason the once the data is loaded, the loading text of the previous chart isn't being removed.

As a workaround, we've added a data.length > 0 check and rendered our own loading indicator until the proper content has been fetched.

ankane commented 6 years ago

Thanks for the update. I'll try to repro with a fresh app.

ankane commented 6 years ago

Should be fixed by #16. Thanks for reporting @Sexual