From: amlethojalen Date: Wed, 6 Jul 2016 00:25:01 +0000 (+1000) Subject: Added ability for drawing a Line Chart as a stepped Line Chart. (reverted from commit... X-Git-Tag: v2.2.0-rc.1~10^2~1^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bddc87020141cde114aa7092a413dab0fb8d3c1d;p=thirdparty%2FChart.js.git Added ability for drawing a Line Chart as a stepped Line Chart. (reverted from commit efd06c886de405f00a93c506ef48a4e306c59af0) --- diff --git a/docs/03-Line-Chart.md b/docs/03-Line-Chart.md index 447b05c5c..d4b6ea902 100644 --- a/docs/03-Line-Chart.md +++ b/docs/03-Line-Chart.md @@ -39,7 +39,7 @@ label | `String` | The label for the dataset which appears in the legend and too xAxisID | `String` | The ID of the x axis to plot this dataset on yAxisID | `String` | The ID of the y axis to plot this dataset on fill | `Boolean` | If true, fill the area under the line -lineTension | `Number` | Bezier curve tension of the line. Set to 0 to draw straightlines. Set to -1 to draw a Stepped Line Chart. *Note* This was renamed from 'tension' but the old name still works. +lineTension | `Number` | Bezier curve tension of the line. Set to 0 to draw straightlines. *Note* This was renamed from 'tension' but the old name still works. backgroundColor | `Color` | The fill color under the line. See [Colors](#getting-started-colors) borderWidth | `Number` | The width of the line in pixels borderColor | `Color` | The color of the line. diff --git a/src/elements/element.line.js b/src/elements/element.line.js index da939fc60..ba7fdf703 100644 --- a/src/elements/element.line.js +++ b/src/elements/element.line.js @@ -29,9 +29,6 @@ module.exports = function(Chart) { previousSkipHandler.call(me, previousPoint, point, nextPoint); } else if (point._view.tension === 0) { ctx.lineTo(point._view.x, point._view.y); - } else if (point._view.tension === -1) { - ctx.lineTo(point._view.x, previousPoint._view.y); - ctx.lineTo(point._view.x, point._view.y); } else { // Line between points ctx.bezierCurveTo(