From d85d6ef9905aeb50fa2a14c2ab3c18446b7050e0 Mon Sep 17 00:00:00 2001 From: "olau@iola.dk" Date: Mon, 12 Jan 2009 17:18:57 +0000 Subject: [PATCH] Patch from Mike R. Williamson to fix make set border color in options parsing code git-svn-id: https://flot.googlecode.com/svn/trunk@126 1e0a6537-2640-0410-bfb7-f154510ff394 --- NEWS.txt | 3 ++- jquery.flot.js | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index 8f6469c..ab0639d 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -25,7 +25,8 @@ Changes: $.plot.formatDate(...) (suggestion by Matt Manela) and even replaced. -- Added "borderColor" option to the grid (patch from achamayou). +- Added "borderColor" option to the grid (patch from achamayou and + patch from Mike R. Williamson). Bug fixes: diff --git a/jquery.flot.js b/jquery.flot.js index 969cb14..42190da 100644 --- a/jquery.flot.js +++ b/jquery.flot.js @@ -13,8 +13,8 @@ var series = [], options = { - // the color theme used for graphs - colors: ["#edc240", "#afd8f8", "#cb4b4b", "#4da74d", "#9440ed"], + // the color theme used for graphs + colors: ["#edc240", "#afd8f8", "#cb4b4b", "#4da74d", "#9440ed"], legend: { show: true, noColumns: 1, // number of colums in legend table @@ -161,7 +161,8 @@ function parseOptions(o) { $.extend(true, options, o); - + if (options.grid.borderColor == null) + options.grid.borderColor = options.grid.color // backwards compatibility, to be removed in future if (options.xaxis.noTicks && options.xaxis.ticks == null) options.xaxis.ticks = options.xaxis.noTicks; @@ -969,7 +970,7 @@ if (options.grid.borderWidth) { // draw border ctx.lineWidth = options.grid.borderWidth; - ctx.strokeStyle = options.grid.borderColor ? options.grid.borderColor : options.grid.color; + ctx.strokeStyle = options.grid.borderColor; ctx.lineJoin = "round"; ctx.strokeRect(0, 0, plotWidth, plotHeight); }