Commit 8d38774c authored by David Schnur's avatar David Schnur

Added axis.tickFont as an override for axis.font.

parent 65c38d0b
......@@ -268,6 +268,7 @@ xaxis, yaxis: {
tickWidth: null or number
tickHeight: null or number
tickFont: null or font spec object
alignTicksWithAxis: null or number
reserveSpace: null or true
......
......@@ -736,11 +736,12 @@ Licensed under the MIT license.
axisOptions = $.extend(true, {}, options.xaxis, axisOptions);
options.xaxes[i] = axisOptions;
fontDefaults.color = axisOptions.color;
if (axisOptions.font) {
axisOptions.font = $.extend({}, fontDefaults, axisOptions.font);
if (!axisOptions.font.color) {
axisOptions.font.color = axisOptions.color;
}
}
if (axisOptions.tickFont || axisOptions.font) {
axisOptions.tickFont = $.extend({}, axisOptions.font || fontDefaults, axisOptions.tickFont);
}
}
......@@ -755,11 +756,12 @@ Licensed under the MIT license.
axisOptions = $.extend(true, {}, options.yaxis, axisOptions);
options.yaxes[i] = axisOptions;
fontDefaults.color = axisOptions.color;
if (axisOptions.font) {
axisOptions.font = $.extend({}, fontDefaults, axisOptions.font);
if (!axisOptions.font.color) {
axisOptions.font.color = axisOptions.color;
}
}
if (axisOptions.tickFont || axisOptions.font) {
axisOptions.tickFont = $.extend({}, axisOptions.font || fontDefaults, axisOptions.tickFont);
}
}
......@@ -1376,7 +1378,7 @@ Licensed under the MIT license.
maxWidth = tickWidth || axis.direction === "x" ? Math.floor(surface.width / (ticks.length || 1)) : null,
legacyStyles = axis.direction + "Axis " + axis.direction + axis.n + "Axis",
layer = "flot-" + axis.direction + "-axis flot-" + axis.direction + axis.n + "-axis " + legacyStyles,
font = opts.font || "flot-tick-label tickLabel";
font = opts.tickFont || "flot-tick-label tickLabel";
for (var i = 0; i < ticks.length; ++i) {
......@@ -2167,7 +2169,7 @@ Licensed under the MIT license.
var box = axis.box,
legacyStyles = axis.direction + "Axis " + axis.direction + axis.n + "Axis",
layer = "flot-" + axis.direction + "-axis flot-" + axis.direction + axis.n + "-axis " + legacyStyles,
font = axis.options.font || "flot-tick-label tickLabel",
font = axis.options.tickFont || "flot-tick-label tickLabel",
tick, x, y, halign, valign;
surface.removeText(layer);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment