beforeUpdate: function(chartInstance) {
            var legendOpts = chartInstance.options.legend;

            if (legendOpts) {
                legendOpts = helpers.configMerge(Chart.defaults.global.legend, legendOpts);