From b13d601d81e103377f25a890fcdeaa9c6ac81f4b Mon Sep 17 00:00:00 2001 From: Richard Wall Date: Sun, 18 Apr 2010 14:02:34 +0100 Subject: a neater way to highlight disabled items in the legend --- index.html | 7 ++++++- jrrd.js | 37 +++++++++++++++---------------------- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/index.html b/index.html index 3d37aa2..5a56fd8 100644 --- a/index.html +++ b/index.html @@ -16,7 +16,8 @@ h2 { width: 750px; padding: 0 0 0 50px; - margin: 10px auto 5px auto; + margin: 20px auto 5px auto; + font-size: 14px; } .loading { @@ -50,6 +51,10 @@ cursor: pointer; } + .legend .disabled { + text-decoration: line-through; + } + input[type=checkbox] { margin: 0; padding: 0; diff --git a/jrrd.js b/jrrd.js index 95d078d..104eccd 100644 --- a/jrrd.js +++ b/jrrd.js @@ -198,27 +198,6 @@ jrrd.Chart = function(template, options) { self.switchDataEnabled($(this).children('.legendLabel').text()); self.draw(); }); - - this.options['legend'] = { - 'labelFormatter': function(label, series) { - return self.legendLabelFormatter(label, series); - } - }; -}; - -jrrd.Chart.prototype.legendLabelFormatter = function(label, series) { - for(var i=0; i', - label, - ''].join(''); - } else { - return label; - } - } - } - return 'unknown: ' + label; }; jrrd.Chart.prototype.addData = function(label, db, enabled) { @@ -272,10 +251,24 @@ jrrd.Chart.prototype.draw = function() { return MochiKit.Async.gatherResults(results) .addCallback( function(self, data) { - for(var i=0; i -1 ) { + labelCell.addClass('disabled'); + } + } + ); }, this) .addErrback( function(self, failure) { -- cgit v1.2.3