summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2017-02-01 13:41:36 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2017-02-01 14:24:21 -0500
commit991212c4d835634626c25db822f5cfeb386fa141 (patch)
tree521b854356dfd226d33615566353ab5793e29afa
parent21c22db81eebb576ff8e134ad1c9efdabf58da3d (diff)
Don't hard-code the Y-axis unit label styles.
-rw-r--r--docs/examples/assets/css/style.css8
-rw-r--r--jarmon/jarmon.js9
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 = $('<div>')
.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()