]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Fix regression with lineTension (#6288)
authorAkihiko Kusanagi <nagi@nagi-p.com>
Fri, 24 May 2019 07:34:09 +0000 (15:34 +0800)
committerSimon Brunel <simonbrunel@users.noreply.github.com>
Fri, 24 May 2019 07:34:09 +0000 (09:34 +0200)
docs/charts/radar.md
src/controllers/controller.line.js
src/controllers/controller.radar.js

index 717942bd8806f7493bc1659737877a051edf882c..c9c6b11eaeb69339720649ef0e601770279d1bb0 100644 (file)
@@ -75,7 +75,7 @@ The radar chart allows a number of properties to be specified for each dataset.
 | [`borderWidth`](#line-styling) | `number` | Yes | - | `3`
 | [`fill`](#line-styling) | <code>boolean&#124;string</code> | Yes | - | `true`
 | [`label`](#general) | `string` | - | - | `''`
-| [`lineTension`](#line-styling) | `number` | - | - | `0.4`
+| [`lineTension`](#line-styling) | `number` | - | - | `0`
 | [`pointBackgroundColor`](#point-styling) | `Color` | Yes | Yes | `'rgba(0, 0, 0, 0.1)'`
 | [`pointBorderColor`](#point-styling) | `Color` | Yes | Yes | `'rgba(0, 0, 0, 0.1)'`
 | [`pointBorderWidth`](#point-styling) | `number` | Yes | Yes | `1`
index 614503c6db4a1401abbba51c9c2cda44a5e75a30..c2d67549bfa7b55635b6711565463b72d46ec4db 100644 (file)
@@ -73,8 +73,8 @@ module.exports = DatasetController.extend({
                var line = meta.dataset;
                var points = meta.data || [];
                var options = me.chart.options;
-               var dataset = me.getDataset();
-               var showLine = me._showLine = valueOrDefault(me._config.showLine, options.showLines);
+               var config = me._config;
+               var showLine = me._showLine = valueOrDefault(config.showLine, options.showLines);
                var i, ilen;
 
                me._xScale = me.getScaleForId(meta.xAxisID);
@@ -83,8 +83,8 @@ module.exports = DatasetController.extend({
                // Update Line
                if (showLine) {
                        // Compatibility: If the properties are defined with only the old name, use those values
-                       if ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) {
-                               dataset.lineTension = dataset.tension;
+                       if (config.tension !== undefined && config.lineTension === undefined) {
+                               config.lineTension = config.tension;
                        }
 
                        // Utility
@@ -161,7 +161,7 @@ module.exports = DatasetController.extend({
         */
        _resolveDatasetElementOptions: function(element) {
                var me = this;
-               var datasetOpts = me._config;
+               var config = me._config;
                var custom = element.custom || {};
                var options = me.chart.options;
                var lineOptions = options.elements.line;
@@ -170,9 +170,9 @@ module.exports = DatasetController.extend({
                // The default behavior of lines is to break at null values, according
                // to https://github.com/chartjs/Chart.js/issues/2435#issuecomment-216718158
                // This option gives lines the ability to span gaps
-               values.spanGaps = valueOrDefault(datasetOpts.spanGaps, options.spanGaps);
-               values.tension = valueOrDefault(datasetOpts.lineTension, lineOptions.tension);
-               values.steppedLine = resolve([custom.steppedLine, datasetOpts.steppedLine, lineOptions.stepped]);
+               values.spanGaps = valueOrDefault(config.spanGaps, options.spanGaps);
+               values.tension = valueOrDefault(config.lineTension, lineOptions.tension);
+               values.steppedLine = resolve([custom.steppedLine, config.steppedLine, lineOptions.stepped]);
 
                return values;
        },
index d83e472a73999fdcad052e4efb5ea196aac641a6..c789250ef128a8047461bce50b217b77bd22b9a6 100644 (file)
@@ -69,12 +69,12 @@ module.exports = DatasetController.extend({
                var line = meta.dataset;
                var points = meta.data || [];
                var scale = me.chart.scale;
-               var dataset = me.getDataset();
+               var config = me._config;
                var i, ilen;
 
                // Compatibility: If the properties are defined with only the old name, use those values
-               if ((dataset.tension !== undefined) && (dataset.lineTension === undefined)) {
-                       dataset.lineTension = dataset.tension;
+               if (config.tension !== undefined && config.lineTension === undefined) {
+                       config.lineTension = config.tension;
                }
 
                // Utility