X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=plugins%2Frange-selector.js;h=f9d4193b2be595e64e97ebc99b39a776c9dd97ac;hb=be79d229c76946257d97e85cc2a0de9d293f1bae;hp=0f72f95eed069545c5374c2ea31894633d120015;hpb=9901b0c18bb8762ae600fa1178d7d38eefbaf45e;p=dygraphs.git diff --git a/plugins/range-selector.js b/plugins/range-selector.js index 0f72f95..f9d4193 100644 --- a/plugins/range-selector.js +++ b/plugins/range-selector.js @@ -176,7 +176,7 @@ rangeSelector.prototype.resize_ = function() { } var plotArea = this.dygraph_.layout_.getPlotArea(); - + var xAxisLabelHeight = 0; if (this.dygraph_.getOptionForAxis('drawAxis', 'x')) { xAxisLabelHeight = this.getOption_('xAxisHeight') || (this.getOption_('axisLabelFontSize') + 2 * this.getOption_('axisTickSize')); @@ -222,7 +222,7 @@ rangeSelector.prototype.createZoomHandles_ = function() { img.style.zIndex = 10; img.style.visibility = 'hidden'; // Initially hidden so they don't show up in the wrong place. img.style.cursor = 'col-resize'; - +//TODO: change image to more options if (/MSIE 7/.test(navigator.userAgent)) { // IE7 doesn't support embedded src data. img.width = 7; img.height = 14; @@ -526,8 +526,8 @@ rangeSelector.prototype.drawStaticLayer_ = function() { } var margin = 0.5; - this.bgcanvas_ctx_.lineWidth = 1; - ctx.strokeStyle = 'gray'; + this.bgcanvas_ctx_.lineWidth = this.getOption_('rangeSelectorBGLineWidth'); + ctx.strokeStyle = this.getOption_('rangeSelectorBGStrokeColor'); ctx.beginPath(); ctx.moveTo(margin, margin); ctx.lineTo(margin, this.canvasRect_.h-margin); @@ -616,7 +616,7 @@ rangeSelector.prototype.drawMiniPlot_ = function() { if (strokeStyle) { this.bgcanvas_ctx_.strokeStyle = strokeStyle; - this.bgcanvas_ctx_.lineWidth = 1.5; + this.bgcanvas_ctx_.lineWidth = this.getOption_('rangeSelectorPlotLineWidth'); ctx.stroke(); } }; @@ -658,7 +658,7 @@ rangeSelector.prototype.computeCombinedSeriesAndLimits_ = function() { if (g.rollPeriod() > 1) { series = dataHandler.rollingAverage(series, g.rollPeriod(), options); } - + rolledSeries.push(series); } @@ -746,7 +746,8 @@ rangeSelector.prototype.drawInteractiveLayer_ = function() { var height = this.canvasRect_.h - margin; var zoomHandleStatus = this.getZoomHandleStatus_(); - ctx.strokeStyle = 'black'; + ctx.strokeStyle = this.getOption_('rangeSelectorFGStrokeColor'); + ctx.lineWidth = this.getOption_('rangeSelectorFGLineWidth'); if (!zoomHandleStatus.isZoomed) { ctx.beginPath(); ctx.moveTo(margin, margin); @@ -758,7 +759,7 @@ rangeSelector.prototype.drawInteractiveLayer_ = function() { var leftHandleCanvasPos = Math.max(margin, zoomHandleStatus.leftHandlePos - this.canvasRect_.x); var rightHandleCanvasPos = Math.min(width, zoomHandleStatus.rightHandlePos - this.canvasRect_.x); - ctx.fillStyle = 'rgba(240, 240, 240, 0.6)'; + ctx.fillStyle = 'rgba(240, 240, 240, ' + this.getOption_('rangeSelectorAlpha').toString() + ')'; ctx.fillRect(0, 0, leftHandleCanvasPos, this.canvasRect_.h); ctx.fillRect(rightHandleCanvasPos, 0, this.canvasRect_.w - rightHandleCanvasPos, this.canvasRect_.h);