Open random-one opened 7 years ago
Thank you for create an issue for your problem, this helps a lot.
I was not able to reproduce your problem, can you please adopt this plnkr to show me when it fails.
@maxklenk I managed to reproduce it but including one more dependency - ui-router
. This is actually my real use case, but I never thought this could break the charts...
Please see my plunk here: https://plnkr.co/KOMKGekcJNkQVOIblFum
It's forked from yours. Switch quickly between the two states(to reproduce it easier) with the buttons on each state until you see the this.config is null
message in the developer console and the chart will not appear until app is reloaded.
puh, I see. Interesting bug, we should check if destruction of the chart is not finished and is responsible for this strange behavior. If you find a solution please tell me.
Like I told you I traced it to the applyZoom
in the ChartService.prototype.stateCallback
function. And when I don't call it it does not happen which is strange to me too.
My "solution"(and I am not proud of it, but I need the charts to always appear) is a monkey-patched chartService
that uses the code of applyZoom before you removed the check.
Maybe this stateCallback
needs to me smarter?
I asked my question in #89, but since it's closed I think I should submit it as an issue, so I'm moving my comment here.
I think I have a problem with the check you dropped for the zoom in v0.3.2. I have a pie chart that gets redrawn because of this zoom and I receive following error in c3:
I don't think pie charts are applicable for zoom, so why to redraw the chart once again? Maybe the problem is somewhere else but this is where I got so far.
@maxklenk Could you please check this? I also tested c3 only without
angular-chart
and withoutangular
and could not reproduce the error.At the point when
applyZoom
is called and the error happens I have abaseConfiguration
that's basically an empty object - nodata['json']
, nodata['types']
, which causes thec3
crash.