Permalink
Browse files

Merge pull request #68 from andromedado/patch-1

Cast tick label to string prior to `replace` call
  • Loading branch information...
2 parents 5c978cd + b52df3c commit 36737fd01bea4665c6b010acfc68709f3786b484 @dnschnur dnschnur committed Jul 29, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 jquery.flot.js
View
@@ -943,7 +943,7 @@
// accept various kinds of newlines, including HTML ones
// (you can actually split directly on regexps in Javascript,
// but IE is unfortunately broken)
- var lines = t.label.replace(/<br ?\/?>|\r\n|\r/g, "\n").split("\n");
+ var lines = String(t.label).replace(/<br ?\/?>|\r\n|\r/g, "\n").split("\n");
for (var j = 0; j < lines.length; ++j) {
var line = { text: lines[j] },
m = ctx.measureText(line.text);

0 comments on commit 36737fd

Please sign in to comment.