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) 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 new file mode 100644 index 0000000..0dbb9d6 --- /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