]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Rename dataset-specific option "tension" to "lineTension" and add a compatibility...
authorJannis Achstetter <jannis.achstetter@schneider-electric.com>
Wed, 20 Apr 2016 15:07:56 +0000 (17:07 +0200)
committerJannis Achstetter <jannis.achstetter@schneider-electric.com>
Thu, 21 Apr 2016 07:40:45 +0000 (09:40 +0200)
src/controllers/controller.line.js

index 48ca501b13d84b53da8391d3a04df293cce5fea9..ec524c5ab62b859d688e08a8938ca34626ddd2c6 100644 (file)
@@ -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),