Skip to content

Commit 5da3eeb

Browse files
fix: manual config not working for ChartJS charts (#1257)
Move override() to after settings.plugins.tooltip is assigned and before new Chart(), so manual config is applied last. Also change $.extend to deep merge so nested plugin options merge rather than replace, preserving tooltip callbacks.
1 parent 1d599d3 commit 5da3eeb

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

js/render-chartjs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@
148148
}
149149
};
150150

151+
override(settings, chart);
152+
151153
var chartjs = new Chart(context, {
152154
type: type,
153155
data: {
@@ -234,8 +236,6 @@
234236
}
235237

236238
handleAxes(settings, chart);
237-
238-
override(settings, chart);
239239
}
240240

241241
function handleAxes(settings, chart){
@@ -501,7 +501,7 @@
501501
if (settings.manual) {
502502
try{
503503
var options = JSON.parse(settings.manual);
504-
$.extend(settings, options);
504+
$.extend(true, settings, options);
505505
delete settings.manual;
506506
}catch(error){
507507
console.error("Error while adding manual configuration override " + settings.manual);

0 commit comments

Comments
 (0)