diff --git a/curvedLines.js b/curvedLines.js index adf1b5b..18d9739 100644 --- a/curvedLines.js +++ b/curvedLines.js @@ -104,7 +104,6 @@ //if the plugin is active register processDatapoints method function processOptions(plot, options) { - if (options.series.curvedLines.active) { plot.hooks.processDatapoints.unshift(processDatapoints); } @@ -112,7 +111,10 @@ //only if the plugin is active function processDatapoints(plot, series, datapoints) { - if (series.curvedLines.apply == true && series.originSeries === undefined) { + var nrPoints = datapoints.points.length / datapoints.pointsize; + var EPSILON = 0.5; //pretty large epsilon but save + + if (series.curvedLines.apply == true && series.originSeries === undefined && nrPoints > (1 + EPSILON)) { if (series.lines.fill) { var pointsTop = calculateCurvePoints(datapoints, series.curvedLines, 1) diff --git a/tests/testSinglePoint.htm b/tests/testSinglePoint.htm new file mode 100644 index 0000000..89fbd5f --- /dev/null +++ b/tests/testSinglePoint.htm @@ -0,0 +1,41 @@ + + + + CurvedLines Plugin for flot + + + + + + +
+ + + + +
+