Adding Commas to Numbers in JSON

254 views
Skip to first unread message

Chris Haslage

unread,
Sep 20, 2012, 4:55:21 PM9/20/12
to jqplot...@googlegroups.com
I am currently running a chat that graphs numbers, I also have a JS script that will allow me to go and put commas in my numbers.  Now the problem is I can't find a way for jqPlot to automatically add commas to my numbers, eg: 1,000 - 10,000 - 100,000 etc etc

Here is the graph I am working on:
http://dev.nexmix.com/advanced/jqplot-test.php

Any suggestions?

Thanks!

Chris

GayashanNA

unread,
Sep 21, 2012, 3:53:59 AM9/21/12
to jqplot...@googlegroups.com
Hi Chris,

Do you want to put commas to the ticks in the axes? If so you can have a look at the the formatString option of the AxisTickRenderer plugin.

http://www.jqplot.com/docs/files/jqplot-axisTickRenderer-js.html#$.jqplot.AxisTickRenderer.formatString

Cheers!

-Gayashan

Chris Haslage

unread,
Sep 21, 2012, 6:30:14 PM9/21/12
to jqplot...@googlegroups.com
Thanks for the tip!

tickOptions: {formatString: "%'d"}

Now, how do I change the tooltip to not separate by comma, EG: X-Axis, Y-Axis - I would like to make it separated by a pipe | or something else to make it easier to read.

Chris

GayashanNA

unread,
Sep 24, 2012, 5:08:14 AM9/24/12
to jqplot...@googlegroups.com
Try the formatString option in the Highlighter plugin.

http://www.jqplot.com/docs/files/plugins/jqplot-highlighter-js.html#$.jqplot.Highlighter.formatString

It allows to format the whole tool-tip.

-Gayashan
Reply all
Reply to author
Forward
0 new messages