projects
/
dygraphs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
2.0.0 release fixes (#815)
[dygraphs.git]
/
src
/
plugins
/
grid.js
diff --git
a/src/plugins/grid.js
b/src/plugins/grid.js
index
25126db
..
626ed94
100644
(file)
--- a/
src/plugins/grid.js
+++ b/
src/plugins/grid.js
@@
-15,7
+15,6
@@
Current bits of jankiness:
"use strict";
"use strict";
-
/**
* Draws the gridlines, i.e. the gray horizontal & vertical lines running the
* length of the chart.
/**
* Draws the gridlines, i.e. the gray horizontal & vertical lines running the
* length of the chart.
@@
-62,8
+61,8
@@
grid.prototype.willDrawChart = function(e) {
ticks = layout.yticks;
ctx.save();
// draw grids for the different y axes
ticks = layout.yticks;
ctx.save();
// draw grids for the different y axes
-
for (var tick of ticks)
{
- if (!tick.has_tick)
continue
;
+
ticks.forEach(tick =>
{
+ if (!tick.has_tick)
return
;
var axis = tick.axis;
if (drawGrid[axis]) {
ctx.save();
var axis = tick.axis;
if (drawGrid[axis]) {
ctx.save();
@@
-82,7
+81,7
@@
grid.prototype.willDrawChart = function(e) {
ctx.restore();
}
ctx.restore();
}
- }
+ }
);
ctx.restore();
}
ctx.restore();
}
@@
-97,8
+96,8
@@
grid.prototype.willDrawChart = function(e) {
}
ctx.strokeStyle = g.getOptionForAxis('gridLineColor', 'x');
ctx.lineWidth = g.getOptionForAxis('gridLineWidth', 'x');
}
ctx.strokeStyle = g.getOptionForAxis('gridLineColor', 'x');
ctx.lineWidth = g.getOptionForAxis('gridLineWidth', 'x');
-
for (var tick of ticks)
{
- if (!tick.has_tick)
continue
;
+
ticks.forEach(tick =>
{
+ if (!tick.has_tick)
return
;
x = halfUp(area.x + tick.pos * area.w);
y = halfDown(area.y + area.h);
ctx.beginPath();
x = halfUp(area.x + tick.pos * area.w);
y = halfDown(area.y + area.h);
ctx.beginPath();
@@
-106,7
+105,7
@@
grid.prototype.willDrawChart = function(e) {
ctx.lineTo(x, area.y);
ctx.closePath();
ctx.stroke();
ctx.lineTo(x, area.y);
ctx.closePath();
ctx.stroke();
- }
+ }
);
if (stroking) {
if (ctx.setLineDash) ctx.setLineDash([]);
}
if (stroking) {
if (ctx.setLineDash) ctx.setLineDash([]);
}