Skip to content

Commit

Permalink
Stroke all vertical gridlines in one go.
Browse files Browse the repository at this point in the history
  • Loading branch information
drewnoakes committed Aug 27, 2014
1 parent 4c0b346 commit 8b2a849
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions smoothie.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,19 +581,19 @@
context.strokeStyle = chartOptions.grid.strokeStyle;
// Vertical (time) dividers.
if (chartOptions.grid.millisPerLine > 0) {
context.beginPath();
for (var t = time - (time % chartOptions.grid.millisPerLine);
t >= oldestValidTime;
t -= chartOptions.grid.millisPerLine) {
var gx = timeToXPixel(t);
if (chartOptions.grid.sharpLines) {
gx -= 0.5;
}
context.beginPath();
context.moveTo(gx, 0);
context.lineTo(gx, dimensions.height);
context.stroke();
context.closePath();
}
context.stroke();
context.closePath();
}

// Horizontal (value) dividers.
Expand Down

0 comments on commit 8b2a849

Please sign in to comment.