From 991212c4d835634626c25db822f5cfeb386fa141 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Wed, 1 Feb 2017 13:41:36 -0500 Subject: Don't hard-code the Y-axis unit label styles. --- docs/examples/assets/css/style.css | 8 ++++++++ jarmon/jarmon.js | 9 ++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/docs/examples/assets/css/style.css b/docs/examples/assets/css/style.css index 2968265..54c3902 100644 --- a/docs/examples/assets/css/style.css +++ b/docs/examples/assets/css/style.css @@ -118,3 +118,11 @@ input[type=text] { position: relative; left: 25px; } + +.yaxisUnitLabel { + width: 100px; + position: absolute; + top: 80px; + left: -110px; + text-align: right; +} diff --git a/jarmon/jarmon.js b/jarmon/jarmon.js index c7af4ed..d62564d 100644 --- a/jarmon/jarmon.js +++ b/jarmon/jarmon.js @@ -671,14 +671,9 @@ jarmon.Chart.prototype.draw = function() { self.template.find('.chart').empty().show(), data, self.options); - // @todo Make this styleable var yaxisUnitLabel = $('
') .text(self.siPrefix + unit) - .css({'width': '100px', - 'position': 'absolute', - 'top': '80px', - 'left': '-110px', - 'text-align': 'right'}); + .addClass('yaxisUnitLabel'); self.template.find('.chart').append(yaxisUnitLabel); // Manipulate and move the Flot generated legend to an @@ -705,7 +700,7 @@ jarmon.Chart.prototype.draw = function() { 'title': ('Data series switch - ' + 'click to turn this data series on or off') }) - .width(orig.width()+20) + .width(orig.width()+20) // @todo Make this styleable .text(label) .prepend( orig.prev() -- cgit v1.1-4-g5e80