You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have discovered that the destroy() method of the Chart object isn't being added to the object prototype if the second "config" parameter to the Chart constructor isn't defined. While the documentation indeed doesn't indicate that the config parameter is optional, the library also doesn't otherwise obviously fail when you don't pass it--you just can't invoke destroy(). My workaround is to pass this minimal config object:
{
data:
{
datasets: []
}
}
I believe the fact that a controller is never hooked up if config isn't passed is the root cause:
if (config) {
this.controller = new Chart.Controller(this);
}
The text was updated successfully, but these errors were encountered:
@sknick I was thinking more about this. I believe that the reason for not going further if there is a config is that you won't know what type of chart to create. Maybe we can bail out earlier in this case and not do anything
Ya, either bail or assume a default. I think "bar" is normally inferred by default when a config is given without a type, right? You could use that as a default.
I have discovered that the destroy() method of the Chart object isn't being added to the object prototype if the second "config" parameter to the Chart constructor isn't defined. While the documentation indeed doesn't indicate that the config parameter is optional, the library also doesn't otherwise obviously fail when you don't pass it--you just can't invoke destroy(). My workaround is to pass this minimal config object:
I believe the fact that a controller is never hooked up if config isn't passed is the root cause:
The text was updated successfully, but these errors were encountered: