Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression with lineTension #6288

Merged
merged 2 commits into from May 24, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/charts/radar.md
Expand Up @@ -75,7 +75,7 @@ The radar chart allows a number of properties to be specified for each dataset.
| [`borderWidth`](#line-styling) | `number` | - | - | `3`
| [`fill`](#line-styling) | <code>boolean&#124;string</code> | - | - | `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`
Expand Down
8 changes: 4 additions & 4 deletions src/controllers/controller.line.js
Expand Up @@ -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 datasetOpts = me._config;
nagix marked this conversation as resolved.
Show resolved Hide resolved
var showLine = me._showLine = valueOrDefault(datasetOpts.showLine, options.showLines);
var i, ilen;

me._xScale = me.getScaleForId(meta.xAxisID);
Expand All @@ -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 ((datasetOpts.tension !== undefined) && (datasetOpts.lineTension === undefined)) {
datasetOpts.lineTension = datasetOpts.tension;
}

// Utility
Expand Down
6 changes: 3 additions & 3 deletions src/controllers/controller.radar.js
Expand Up @@ -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 datasetOpts = 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 ((datasetOpts.tension !== undefined) && (datasetOpts.lineTension === undefined)) {
datasetOpts.lineTension = datasetOpts.tension;
}

// Utility
Expand Down