From: Jannis Achstetter Date: Wed, 20 Apr 2016 15:07:56 +0000 (+0200) Subject: Rename dataset-specific option "tension" to "lineTension" and add a compatibility... X-Git-Tag: 2.1.0~53^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bc0f0f0fa742408544ded3805d6dcf2e62381be3;p=thirdparty%2FChart.js.git Rename dataset-specific option "tension" to "lineTension" and add a compatibility-clause to support the old name as well --- diff --git a/src/controllers/controller.line.js b/src/controllers/controller.line.js index 48ca501b1..ec524c5ab 100644 --- a/src/controllers/controller.line.js +++ b/src/controllers/controller.line.js @@ -86,9 +86,16 @@ module.exports = function(Chart) { // Data line._children = points; // Model + + // Compatibility: If the properties are defined with only the old name, use those values + if ((this.getDataset().tension !== undefined) && (this.getDataset().lineTension === undefined)) + { + this.getDataset().lineTension = this.getDataset().tension; + } + line._model = { // Appearance - tension: line.custom && line.custom.tension ? line.custom.tension : helpers.getValueOrDefault(this.getDataset().tension, this.chart.options.elements.line.tension), + tension: line.custom && line.custom.tension ? line.custom.tension : helpers.getValueOrDefault(this.getDataset().lineTension, this.chart.options.elements.line.tension), backgroundColor: line.custom && line.custom.backgroundColor ? line.custom.backgroundColor : (this.getDataset().backgroundColor || this.chart.options.elements.line.backgroundColor), borderWidth: line.custom && line.custom.borderWidth ? line.custom.borderWidth : (this.getDataset().borderWidth || this.chart.options.elements.line.borderWidth), borderColor: line.custom && line.custom.borderColor ? line.custom.borderColor : (this.getDataset().borderColor || this.chart.options.elements.line.borderColor),