X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=plugins%2Frange-selector.js;h=4c1e938ed3e49cee9b1aabdf81bc5bb199c475d5;hb=26ee953643ccd2d32e38e6b60b20e6a01c1dc9ba;hp=6819eea30cea7fbb8cc4f35bee5a6b1f3562c441;hpb=79cb28dd681a26f9e7824f61d95c7458ca5104e7;p=dygraphs.git diff --git a/plugins/range-selector.js b/plugins/range-selector.js index 6819eea..4c1e938 100644 --- a/plugins/range-selector.js +++ b/plugins/range-selector.js @@ -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_('rangeSelectorBackgroundLineWidth'); + ctx.strokeStyle = this.getOption_('rangeSelectorBackgroundStrokeColor'); ctx.beginPath(); ctx.moveTo(margin, margin); ctx.lineTo(margin, this.canvasRect_.h-margin); @@ -619,7 +619,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(); } }; @@ -749,7 +749,8 @@ rangeSelector.prototype.drawInteractiveLayer_ = function() { var height = this.canvasRect_.h - margin; var zoomHandleStatus = this.getZoomHandleStatus_(); - ctx.strokeStyle = 'black'; + ctx.strokeStyle = this.getOption_('rangeSelectorForegroundStrokeColor'); + ctx.lineWidth = this.getOption_('rangeSelectorForegroundLineWidth'); if (!zoomHandleStatus.isZoomed) { ctx.beginPath(); ctx.moveTo(margin, margin); @@ -761,7 +762,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);