]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
"tension" is a property of the line, not of the point
authorJannis Achstetter <jannis.achstetter@schneider-electric.com>
Wed, 20 Apr 2016 14:59:31 +0000 (16:59 +0200)
committerJannis Achstetter <jannis.achstetter@schneider-electric.com>
Thu, 21 Apr 2016 07:17:51 +0000 (09:17 +0200)
src/controllers/controller.line.js
test/controller.line.tests.js

index dcce78f995eafacc642694edb03d18af010b1b22..48ca501b13d84b53da8391d3a04df293cce5fea9 100644 (file)
@@ -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
index a4d12bdb35fd779e6c82c37aa63880fa8d5e7248..624c38584a4db1f3da975519f6e83e31102ad78a 100644 (file)
@@ -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)',