From: Jannis Achstetter Date: Wed, 20 Apr 2016 14:59:31 +0000 (+0200) Subject: "tension" is a property of the line, not of the point X-Git-Tag: 2.1.0~53^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b0c1e9cb695d1fd8eedec4f2ff602f341573da9c;p=thirdparty%2FChart.js.git "tension" is a property of the line, not of the point --- diff --git a/src/controllers/controller.line.js b/src/controllers/controller.line.js index dcce78f99..48ca501b1 100644 --- a/src/controllers/controller.line.js +++ b/src/controllers/controller.line.js @@ -182,7 +182,6 @@ module.exports = function(Chart) { x: xScale.getPixelForValue(this.getDataset().data[index], index, this.index, this.chart.isCombo), y: reset ? scaleBase : this.calculatePointY(this.getDataset().data[index], index, this.index, this.chart.isCombo), // Appearance - tension: point.custom && point.custom.tension ? point.custom.tension : helpers.getValueOrDefault(this.getDataset().tension, this.chart.options.elements.line.tension), radius: point.custom && point.custom.radius ? point.custom.radius : helpers.getValueAtIndexOrDefault(this.getDataset().radius, index, this.chart.options.elements.point.radius), pointStyle: point.custom && point.custom.pointStyle ? point.custom.pointStyle : helpers.getValueAtIndexOrDefault(this.getDataset().pointStyle, index, this.chart.options.elements.point.pointStyle), backgroundColor: this.getPointBackgroundColor(point, index), @@ -233,7 +232,7 @@ module.exports = function(Chart) { helpers.previousItem(this.getDataset().metaData, index)._model, point._model, helpers.nextItem(this.getDataset().metaData, index)._model, - point._model.tension + this.getDataset().metaDataset._model.tension ); // Prevent the bezier going outside of the bounds of the graph diff --git a/test/controller.line.tests.js b/test/controller.line.tests.js index a4d12bdb3..624c38584 100644 --- a/test/controller.line.tests.js +++ b/test/controller.line.tests.js @@ -284,7 +284,6 @@ describe('Line controller tests', function() { radius: 3, pointStyle: 'circle', skip: false, - tension: 0.1, // Point x: 82, @@ -300,7 +299,6 @@ describe('Line controller tests', function() { expect(chart.data.datasets[0].metaData[1]._model).toEqual({ x: 132, y: 15, - tension: 0.1, radius: 3, pointStyle: 'circle', backgroundColor: 'rgba(0,0,0,0.1)', @@ -317,7 +315,6 @@ describe('Line controller tests', function() { expect(chart.data.datasets[0].metaData[2]._model).toEqual({ x: 182, y: 156, - tension: 0.1, radius: 3, pointStyle: 'circle', backgroundColor: 'rgba(0,0,0,0.1)', @@ -339,7 +336,6 @@ describe('Line controller tests', function() { radius: 3, pointStyle: 'circle', skip: false, - tension: 0.1, // Point x: 232, @@ -391,7 +387,6 @@ describe('Line controller tests', function() { expect(chart.data.datasets[0].metaData[0]._model).toEqual({ x: 82, y: 62, - tension: 0, radius: 22, pointStyle: 'circle', backgroundColor: 'rgb(128, 129, 130)', @@ -408,7 +403,6 @@ describe('Line controller tests', function() { expect(chart.data.datasets[0].metaData[1]._model).toEqual({ x: 132, y: 15, - tension: 0, radius: 22, pointStyle: 'circle', backgroundColor: 'rgb(128, 129, 130)', @@ -430,7 +424,6 @@ describe('Line controller tests', function() { radius: 22, pointStyle: 'circle', skip: false, - tension: 0, // Point x: 182, @@ -451,7 +444,6 @@ describe('Line controller tests', function() { radius: 22, pointStyle: 'circle', skip: false, - tension: 0, // Point x: 232, @@ -466,7 +458,7 @@ describe('Line controller tests', function() { // Use custom styles for lines & first point chart.data.datasets[0].metaDataset.custom = { - tension: 0.25, + tension: 0.15, backgroundColor: 'rgb(55, 55, 54)', borderColor: 'rgb(8, 7, 6)', borderWidth: 0.3, @@ -483,7 +475,6 @@ describe('Line controller tests', function() { backgroundColor: 'rgb(0, 1, 3)', borderColor: 'rgb(4, 6, 8)', borderWidth: 0.787, - tension: 0.15, skip: true, hitRadius: 5, }; @@ -499,7 +490,7 @@ describe('Line controller tests', function() { borderJoinStyle: 'round', borderWidth: 0.3, fill: true, - tension: 0.25, + tension: 0.15, scaleTop: 0, scaleBottom: 200, @@ -509,7 +500,6 @@ describe('Line controller tests', function() { expect(chart.data.datasets[0].metaData[0]._model).toEqual({ x: 82, y: 62, - tension: 0.15, radius: 2.2, pointStyle: 'circle', backgroundColor: 'rgb(0, 1, 3)',