From 8a5ad820c12321ca34058018f7ef4c31497eaa6f Mon Sep 17 00:00:00 2001 From: Eric Puidokas Date: Mon, 18 Feb 2013 16:07:00 -0500 Subject: [PATCH 1/3] Fix compatibility with thresholds --- curvedLines.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/curvedLines.js b/curvedLines.js index 1ad40f9..ac8a0a5 100644 --- a/curvedLines.js +++ b/curvedLines.js @@ -104,13 +104,13 @@ function processOptions(plot, options) { if (options.series.curvedLines.active) { - plot.hooks.processDatapoints.push(processDatapoints); + plot.hooks.processDatapoints.unshift(processDatapoints); } } //only if the plugin is active function processDatapoints(plot, series, datapoints) { - if (series.curvedLines.apply == true) { + if (series.curvedLines.apply == true && series.originSeries === undefined) { if (series.lines.fill) { var pointsTop = calculateCurvePoints(datapoints, series.curvedLines, 1) From cf9b23b0a478df01cc1e53aac1bc28eb310251a9 Mon Sep 17 00:00:00 2001 From: Eric Puidokas Date: Mon, 18 Feb 2013 16:30:15 -0500 Subject: [PATCH 2/3] Added threshold example --- exampleThreshold.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 exampleThreshold.js diff --git a/exampleThreshold.js b/exampleThreshold.js new file mode 100644 index 0000000..c889607 --- /dev/null +++ b/exampleThreshold.js @@ -0,0 +1,19 @@ +$(function () { + + //
+ + + var d1 = [[20,20], [42,60], [54, 20], [80,80]]; + + var options = { series: { + curvedLines: { + active: true + }, + threshold: { below: 40, color: "rgb(0, 0, 0)" } + }, + axis: { min:10, max: 100}, + yaxis: { min:10, max: 90} + }; + + $.plot($("#flotOrig"), [{data: d1, lines: { show: true, lineWidth: 3}, curvedLines: {apply:true}}, {data: d1, points: { show: true }}], options); +}); \ No newline at end of file From f4bc2096217eba66fc3a1b6036a5544c4fac97ba Mon Sep 17 00:00:00 2001 From: Eric Puidokas Date: Mon, 18 Feb 2013 16:32:34 -0500 Subject: [PATCH 3/3] Fix example comment html --- example.js | 2 +- exampleFillMultiAxis.js | 2 +- exampleFit.js | 2 +- exampleFlotWithDates.js | 2 +- exampleThreshold.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/example.js b/example.js index 91126d9..7caf215 100644 --- a/example.js +++ b/example.js @@ -1,6 +1,6 @@ $(function () { - //
+ //
var d1 = [[20,20], [42,60], [54, 20], [80,80]]; diff --git a/exampleFillMultiAxis.js b/exampleFillMultiAxis.js index 39e1c38..54637bf 100644 --- a/exampleFillMultiAxis.js +++ b/exampleFillMultiAxis.js @@ -1,6 +1,6 @@ $(function () { - //
+ //
var d1 = [[20,20], [42,60], [54, 20], [80,80]]; var d2 = [[20,700], [80,300]]; diff --git a/exampleFit.js b/exampleFit.js index bfe50ee..af1c371 100644 --- a/exampleFit.js +++ b/exampleFit.js @@ -1,6 +1,6 @@ $(function () { - //
+ //
var d1 = [[20,20], [42,60], [54, 30], [80,80]]; diff --git a/exampleFlotWithDates.js b/exampleFlotWithDates.js index c7f5b2b..8772766 100644 --- a/exampleFlotWithDates.js +++ b/exampleFlotWithDates.js @@ -1,6 +1,6 @@ $(function() { - //
+ //
var d1 = [[new Date(2000, 8, 1, 10), 20], [new Date(2000, 8, 1, 12), 60], [new Date(2000, 8, 1, 14), 30], [new Date(2000, 8, 1, 22), 80]]; diff --git a/exampleThreshold.js b/exampleThreshold.js index c889607..0dbb9d6 100644 --- a/exampleThreshold.js +++ b/exampleThreshold.js @@ -1,6 +1,6 @@ $(function () { - //
+ //
var d1 = [[20,20], [42,60], [54, 20], [80,80]];