Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix incorrect default for xaxes/yaxes tickColor.

The way in which xaxes/yaxes inherit options from xaxis/yaxis resulted
in a minor bug, where tickColor defaulted to the xaxis/yaxis color
instead of the color for its axis.  Fixed by applying the default before
extending the per-axis options, resolving #984.

There's still some questionable behavior here; this section should be
revisited for 0.9, especially with an eye towards removing some of the
code that only exists for backwards-compatibility.
  • Loading branch information...
commit 55e671b7950a64c3c1cdb0864481a31feb528e1b 1 parent 4e8d853
@dnschnur dnschnur authored
Showing with 16 additions and 2 deletions.
  1. +16 −2 jquery.flot.js
View
18 jquery.flot.js
@@ -674,8 +674,15 @@ Licensed under the MIT license.
axisCount = options.xaxes.length || 1;
for (i = 0; i < axisCount; ++i) {
- axisOptions = $.extend(true, {}, options.xaxis, options.xaxes[i]);
+
+ axisOptions = options.xaxes[i];
+ if (axisOptions && !axisOptions.tickColor) {
+ axisOptions.tickColor = axisOptions.color;
+ }
+
+ axisOptions = $.extend(true, {}, options.xaxis, axisOptions);
options.xaxes[i] = axisOptions;
+
if (axisOptions.font) {
axisOptions.font = $.extend({}, fontDefaults, axisOptions.font);
if (!axisOptions.font.color) {
@@ -686,8 +693,15 @@ Licensed under the MIT license.
axisCount = options.yaxes.length || 1;
for (i = 0; i < axisCount; ++i) {
- axisOptions = $.extend(true, {}, options.yaxis, options.yaxes[i]);
+
+ axisOptions = options.yaxes[i];
+ if (axisOptions && !axisOptions.tickColor) {
+ axisOptions.tickColor = axisOptions.color;
+ }
+
+ axisOptions = $.extend(true, {}, options.yaxis, axisOptions);
options.yaxes[i] = axisOptions;
+
if (axisOptions.font) {
axisOptions.font = $.extend({}, fontDefaults, axisOptions.font);
if (!axisOptions.font.color) {
Please sign in to comment.
Something went wrong with that request. Please try again.