From 9a8a2a60b4eee87709d473ddd1b9c62c442a8610 Mon Sep 17 00:00:00 2001 From: Miguel Angel Mulero Martinez Date: Tue, 23 Jun 2020 16:19:18 +0200 Subject: [PATCH] Add a shadow to the text of the Spectrum graph --- js/graph_spectrum_plot.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/graph_spectrum_plot.js b/js/graph_spectrum_plot.js index 54cfcf34..43cacb59 100644 --- a/js/graph_spectrum_plot.js +++ b/js/graph_spectrum_plot.js @@ -478,6 +478,9 @@ GraphSpectrumPlot._drawNotCachedElements = function() { }; GraphSpectrumPlot._drawAxisLabel = function(canvasCtx, axisLabel, X, Y, align, baseline) { + + canvasCtx.save(); + canvasCtx.font = `${((this._isFullScreen)? this._drawingParams.fontSizeFrameLabelFullscreen : this._drawingParams.fontSizeFrameLabel)}pt ${DEFAULT_FONT_FACE}`; canvasCtx.fillStyle = "rgba(255,255,255,0.9)"; if(align) { @@ -490,7 +493,13 @@ GraphSpectrumPlot._drawAxisLabel = function(canvasCtx, axisLabel, X, Y, align, b } else { canvasCtx.textBaseline = 'alphabetic'; } + canvasCtx.shadowColor = 'black'; + canvasCtx.strokeStyle = 'black'; + canvasCtx.shadowBlur = 3; + canvasCtx.strokeText(axisLabel, X, Y); canvasCtx.fillText(axisLabel, X, Y); + + canvasCtx.restore(); }; GraphSpectrumPlot._drawHorizontalGridLines = function(canvasCtx, maxValue, LEFT, TOP, WIDTH, HEIGHT, MARGIN_UP_LABEL, unitsLabel) {