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

pull/1/head
Michael Mayer 15 years ago
parent b2fedcd828
commit 82ac1aecb0

@ -1692,7 +1692,10 @@
// 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
ctx.fillStyle = axis.options.color;
ctx.font = f.style + " " + f.variant + " " + f.weight + " " + f.size + "px '" + f.family + "'";
// Important: Don't use quotes around axis.font.family! Just around single
// font names like 'Times New Roman' that have a space in it, or if it includes a
// special character).
ctx.font = f.style + " " + f.variant + " " + f.weight + " " + f.size + "px " + f.family;
ctx.textAlign = "start";
// middle align the labels - top would be more
// natural, but browsers can differ a pixel or two in

Loading…
Cancel
Save