X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=plugins%2Frange-selector.js;h=4c1e938ed3e49cee9b1aabdf81bc5bb199c475d5;hb=8db6393ec8cac592f323724e43a2a7122a84614f;hp=fea0cf3a3b43dc1f871ffa181523f1240603dfba;hpb=b77d7a56cdc26a9846d6d6fa008974be4c0564e9;p=dygraphs.git diff --git a/plugins/range-selector.js b/plugins/range-selector.js index fea0cf3..4c1e938 100644 --- a/plugins/range-selector.js +++ b/plugins/range-selector.js @@ -526,8 +526,8 @@ rangeSelector.prototype.drawStaticLayer_ = function() { } var margin = 0.5; - this.bgcanvas_ctx_.lineWidth = this.getOption_('rangeSelectorBGLineWidth'); - ctx.strokeStyle = this.getOption_('rangeSelectorBGStrokeColor'); + 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); @@ -543,12 +543,11 @@ rangeSelector.prototype.drawStaticLayer_ = function() { */ rangeSelector.prototype.drawMiniPlot_ = function() { var fillStyle = this.getOption_('rangeSelectorPlotFillColor'); + var fillGradientStyle = this.getOption_('rangeSelectorPlotFillGradientColor'); var strokeStyle = this.getOption_('rangeSelectorPlotStrokeColor'); if (!fillStyle && !strokeStyle) { return; } - var gradientFillStyle = this.getOption_('rangeSelectorPlotGradientColor'); - if (!gradientFillStyle) { gradientFillStyle = fillStyle; } var stepPlot = this.getOption_('stepPlot'); @@ -610,7 +609,9 @@ rangeSelector.prototype.drawMiniPlot_ = function() { if (fillStyle) { var lingrad = this.bgcanvas_ctx_.createLinearGradient(0, 0, 0, canvasHeight); - lingrad.addColorStop(0, gradientFillStyle); + if (fillGradientStyle) { + lingrad.addColorStop(0, fillGradientStyle); + } lingrad.addColorStop(1, fillStyle); this.bgcanvas_ctx_.fillStyle = lingrad; ctx.fill(); @@ -748,8 +749,8 @@ rangeSelector.prototype.drawInteractiveLayer_ = function() { var height = this.canvasRect_.h - margin; var zoomHandleStatus = this.getZoomHandleStatus_(); - ctx.strokeStyle = this.getOption_('rangeSelectorFGStrokeColor'); - ctx.lineWidth = this.getOption_('rangeSelectorFGLineWidth'); + ctx.strokeStyle = this.getOption_('rangeSelectorForegroundStrokeColor'); + ctx.lineWidth = this.getOption_('rangeSelectorForegroundLineWidth'); if (!zoomHandleStatus.isZoomed) { ctx.beginPath(); ctx.moveTo(margin, margin);