- if (stepPlot) {
- ctx.lineTo(point.canvasx, prevYs[0]);
- if(currBaseline) {
- // Draw to the bottom of the baseline
- ctx.lineTo(point.canvasx, currBaseline[1]);
- } else {
- ctx.lineTo(point.canvasx, newYs[1]);
- }
+ } else {
+ newYs = [ point.canvasy, axisY ];
+ }
+ if (!isNaN(prevX)) {
+ ctx.moveTo(prevX, prevYs[0]);
+
+ if (stepPlot) {
+ ctx.lineTo(point.canvasx, prevYs[0]);
+ if(currBaseline) {
+ // Draw to the bottom of the baseline
+ ctx.lineTo(point.canvasx, currBaseline[1]);