Skip to content

Commit 82ac1ae

Browse files
committed
Fixes the font of the axis labels by removing single quotes in CSS font property (otherwise a list of fonts is interpreted as a single font name or already quoted font names are quoted twice
1 parent b2fedcd commit 82ac1ae

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

jquery.flot.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,10 @@
16921692
// placeholder.append('<div style="position:absolute;opacity:0.10;background-color:red;left:' + box.left + 'px;top:' + box.top + 'px;width:' + box.width + 'px;height:' + box.height + 'px"></div>') // debug
16931693

16941694
ctx.fillStyle = axis.options.color;
1695-
ctx.font = f.style + " " + f.variant + " " + f.weight + " " + f.size + "px '" + f.family + "'";
1695+
// Important: Don't use quotes around axis.font.family! Just around single
1696+
// font names like 'Times New Roman' that have a space in it, or if it includes a
1697+
// special character).
1698+
ctx.font = f.style + " " + f.variant + " " + f.weight + " " + f.size + "px " + f.family;
16961699
ctx.textAlign = "start";
16971700
// middle align the labels - top would be more
16981701
// natural, but browsers can differ a pixel or two in

0 commit comments

Comments
 (0)