From: Jukka Kurkela Date: Thu, 16 Jan 2020 21:20:22 +0000 (+0200) Subject: Rebuild legend after datasets are updated (#6969) X-Git-Tag: v3.0.0-alpha~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2e880ed99d65435837cb71611a8565604e5b6d15;p=thirdparty%2FChart.js.git Rebuild legend after datasets are updated (#6969) --- diff --git a/src/plugins/plugin.legend.js b/src/plugins/plugin.legend.js index 2c7e7e761..5fe836bc2 100644 --- a/src/plugins/plugin.legend.js +++ b/src/plugins/plugin.legend.js @@ -688,7 +688,7 @@ export default { } }, - beforeUpdate: function(chart) { + afterUpdate: function(chart) { var legendOpts = chart.options.legend; var legend = chart.legend; @@ -698,6 +698,7 @@ export default { if (legend) { layouts.configure(chart, legend, legendOpts); legend.options = legendOpts; + legend.buildLabels(); } else { createNewLegendAndAttach(chart, legendOpts); }