I just found that when a tooltip, beginning with $1, is placed exactly on a tick with the same value the $1 is removed due the $ behaviour on String#replace
From String#replace docs:
$n or $nn: Where n or nn are decimal digits, inserts the nth parenthesized submatch string, provided the first argument was a RegExp object.
I just found that when a tooltip, beginning with
$1
, is placed exactly on a tick with the same value the$1
is removed due the$
behaviour onString#replace
It's easier to visualize this with this example: Example here: https://jsbin.com/muvakuxefu/1/edit?output
Solution: Uses replaces to change a single dollar (
$
) to a double dollar ($$
), so whencontent.replace
run we continue with the original$
.Here is my solution (this PR changes): https://jsbin.com/tubuxutado/1/edit?output
On my production scenario I have a point with
$127,40
dollars exactly on127,40
tick, and the tooltip value became27,40
.Another solution to this is using a double dollar on
tickFormatter
, but I don't know if this is the best solution: