Can I please have some help to format the string on the Y Axis that has a '%' sign.
Here is the code for a '$':
tickOptions: {formatString: '$%d'}
How do I format the string to use a '%' sign as the '%' sign is used as a 'keyword'?
Try something like this:
tickFormatter = function (format, val) {
return val+"%";
}
And add this option to the plot:
axes: {
yaxis: {
tickOptions: {
formatter: tickFormatter
}
}
http://jsfiddle.net/pabloker/9ZrKA/3/
To write a '%' sign you have to double it :
axes:
{yaxis:
{tickOptions:
{formatString: '%%%d'}
}
}
%%%d will write '%10' if your value is 10.
Similarly, %d%% will write '10%' if again your value is 10.
So you just have to replace the '$' sign by '%%'.
Anthony.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With