From a10f895904912aa04e675b0984c219277c72d99d Mon Sep 17 00:00:00 2001 From: Charles Hacskaylo Date: Tue, 12 Jan 2016 18:20:52 -0800 Subject: [PATCH] [Frontend] Mods to allow plot tick labels to ellipsis to left open #337 Fixing code due to circleci fail in pull request; --- platform/features/plot/src/elements/PlotTickGenerator.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/platform/features/plot/src/elements/PlotTickGenerator.js b/platform/features/plot/src/elements/PlotTickGenerator.js index 57c6f6c5cf..61f2faf827 100644 --- a/platform/features/plot/src/elements/PlotTickGenerator.js +++ b/platform/features/plot/src/elements/PlotTickGenerator.js @@ -57,14 +57,17 @@ define( PlotTickGenerator.prototype.generateTicks = function (start, span, count, format) { var step = span / (count - 1), result = [], + tickVal = '', i; for (i = 0; i < count; i += 1) { + tickVal = format(i * step + start).toString(); + // Make the tick value have its ellipsis on the least significant left side by reversing it here, + // and then reversing it again via CSS. + tickVal = tickVal.split('').reverse().join(''); result.push({ //If data to show, display label for each tick line, otherwise show lines but suppress labels. - // Make the tick value have its ellipsis on the least significant left side by reversing it here, - // and then reversing it again via CSS. Relevant styling in _plots-main.scss. - label: span > 0 ? format(i * step + start).split('').reverse().join('') : '' + label: span > 0 ? : '' }); }