var Chart = function(context, config) {
var me = this;
var helpers = Chart.helpers;
- me.config = config;
+ me.config = config || {
+ data: {
+ datasets: []
+ }
+ };
// Support a jQuery'd canvas element
if (context.length && context[0].getContext) {
// High pixel density displays - multiply the size of the canvas height/width by the device pixel ratio, then scale.
helpers.retinaScale(me);
-
- if (config) {
- me.controller = new Chart.Controller(me);
- }
+ me.controller = new Chart.Controller(me);
// Always bind this so that if the responsive state changes we still work
helpers.addResizeListener(context.canvas.parentNode, function() {