format ticks as money

1,952 views
Skip to first unread message

Brad Mc

unread,
Feb 8, 2012, 3:41:14 PM2/8/12
to jqplot-users
Hi, I've been searching for a way to format ticks as money / currency.
I'm able to follow the documentation to get the $ sign working but I'm
having issues getting the commas & decimals in there. I've tried using
my own formatter but haven't gotten it to work yet. Has anyone tried
to do this yet?

Thanks,
Brad

Brad Mc

unread,
Feb 8, 2012, 4:07:27 PM2/8/12
to jqplot-users
I knew that I'd answer my own question as soon as I posted this. I
found the answer on this page: http://www.jqplot.com/deploy/dist/examples/barLineAnimated.html

Change this: tickOptions: {formatString: '$%d'}

To this: tickOptions: {formatString: "$%'d"}

And it formats the money correctly.
Reply all
Reply to author
Forward
0 new messages