Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tooltip displays without leading $1 #16

Closed
geerlingguy opened this issue Jan 21, 2013 · 2 comments
Closed

tooltip displays without leading $1 #16

geerlingguy opened this issue Jan 21, 2013 · 2 comments

Comments

@geerlingguy
Copy link

It seems that if I have a tickFormatter defined like so:

tickFormatter: function(val, axis) {
  return '$' + val.toLocaleString();
},

And the number (val) that's passed in begins with a 1 (e.g. 17527 or 123), then the leading $1 in the formatted tick is removed, resulting in something like 7,527 or 23 instead of $17,527 or $123...

I was scratching my head over this, as the ticks display correctly on the left side of the flot graph, but they display incorrectly in the hovered tooltip. For tooltipOpts, I have content: "%y".

@krzysu krzysu closed this as completed in 372a29d Jun 17, 2013
@geerlingguy
Copy link
Author

Thanks!

@ewjoachim
Copy link

I believe the good solution is to make sure that $n never gets interpreted as a regex special value but as a dollar sign and a number, escaping dollars with a backslash should probably do the trick doesn't it ?

@lmacko lmacko mentioned this issue Jan 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants