mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-14 04:06:49 +01:00
Rename dataset-specific option "tension" to "lineTension" and add a compatibility-clause to support the old name as well
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user