From 8309363a62d8c1f2c87f846096461c8e7be45edf Mon Sep 17 00:00:00 2001 From: "olau@iola.dk" Date: Tue, 4 Dec 2007 16:29:54 +0000 Subject: [PATCH] Take the grid background color into account when auto-detecting the legend background git-svn-id: https://flot.googlecode.com/svn/trunk@11 1e0a6537-2640-0410-bfb7-f154510ff394 --- jquery.flot.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/jquery.flot.js b/jquery.flot.js index 87052a1..8427f8e 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -977,8 +977,14 @@ // separately to avoid blended labels and // label boxes var c = options.legend.backgroundColor; - if (c == null) - c = parseColor(extractColor(div)).adjust(null, null, null, 1).toString(); + if (c == null) { + var tmp; + if (options.grid.backgroundColor != null) + tmp = options.grid.backgroundColor; + else + tmp = extractColor(div); + c = parseColor(tmp).adjust(null, null, null, 1).toString(); + } $('
').appendTo(target).css('opacity', options.legend.backgroundOpacity); }