X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=src%2Fplugins%2Faxes.js;h=a0169bcb90c76c5386e5376fcccffa754fe2e10c;hb=refs%2Fheads%2Fmaster;hp=2d9e31f92306b946c65ea5fce18479da9eb3ecd8;hpb=cf61aeb77cda5e2638b1f00588dcd90394afd24c;p=dygraphs.git diff --git a/src/plugins/axes.js b/src/plugins/axes.js index 2d9e31f..a0169bc 100644 --- a/src/plugins/axes.js +++ b/src/plugins/axes.js @@ -164,8 +164,8 @@ axes.prototype.willDrawChart = function(e) { if (layout.yticks && layout.yticks.length > 0) { var num_axes = g.numAxes(); var getOptions = [makeOptionGetter('y'), makeOptionGetter('y2')]; - for (var tick of layout.yticks) { - if (tick.label === undefined) continue; // this tick only has a grid line. + layout.yticks.forEach(tick => { + if (tick.label === undefined) return; // this tick only has a grid line. x = area.x; var sgn = 1; var prec_axis = 'y1'; @@ -208,7 +208,7 @@ axes.prototype.willDrawChart = function(e) { label.style.width = getAxisOption('axisLabelWidth') + 'px'; containerDiv.appendChild(label); this.ylabels_.push(label); - } + }); // The lowest tick on the y-axis often overlaps with the leftmost // tick on the x-axis. Shift the bottom tick up a little bit to @@ -257,8 +257,8 @@ axes.prototype.willDrawChart = function(e) { if (g.getOptionForAxis('drawAxis', 'x')) { if (layout.xticks) { var getAxisOption = makeOptionGetter('x'); - for (var tick of layout.xticks) { - if (tick.label === undefined) continue; // this tick only has a grid line. + layout.xticks.forEach(tick => { + if (tick.label === undefined) return; // this tick only has a grid line. x = area.x + tick.pos * area.w; y = area.y + area.h; @@ -288,7 +288,7 @@ axes.prototype.willDrawChart = function(e) { label.style.width = getAxisOption('axisLabelWidth') + 'px'; containerDiv.appendChild(label); this.xlabels_.push(label); - } + }); } context.strokeStyle = g.getOptionForAxis('axisLineColor', 'x');