mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-05 16:04:03 +01:00
Merge pull request #2696 from NoelOConnell/master
Fix for chart title not updating
This commit is contained in:
@@ -29,10 +29,15 @@ module.exports = function(Chart) {
|
||||
|
||||
// These methods are ordered by lifecyle. Utilities then follow.
|
||||
|
||||
beforeUpdate: noop,
|
||||
beforeUpdate: function () {
|
||||
var chartOpts = this.chart.options;
|
||||
if (chartOpts && chartOpts.title) {
|
||||
this.options = helpers.configMerge(Chart.defaults.global.title, chartOpts.title);
|
||||
}
|
||||
},
|
||||
update: function(maxWidth, maxHeight, margins) {
|
||||
|
||||
// Update Lifecycle - Probably don't want to ever extend or overwrite this function ;)
|
||||
// Update Lifecycle
|
||||
this.beforeUpdate();
|
||||
|
||||
// Absorb the master measurements
|
||||
@@ -195,4 +200,4 @@ module.exports = function(Chart) {
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user