Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jqplot tickOptions formatString options

Tags:

jquery

jqplot

I'm incredibly new to web dev. What I'm finding frustrating are the options used in the axesRendererDefaults options in jqplot.

According to this link:

the way to specify how a tick will appear on the axis (either X or Y) will be determined by what is specified by the formatString: '' option.

What options are available for formatString option? In the tutorial given on the jqplot page, they pass options such as: %d, $%d and %n. How do I find the full list of options available?

Are these formatting options separate from jqplot and actually a property of jQuery?

like image 862
Greg Meyer Avatar asked Dec 20 '12 09:12

Greg Meyer


1 Answers

The format commands are similar (if not identical) to those for the sprintf function.

A decent reference for these is http://perldoc.perl.org/functions/sprintf.html

e.g. yaxis: { tickOptions: {formatString: '%.2f'} }

will output a floating point number to 2 decimal places.

like image 86
Andy Lorenz Avatar answered Nov 15 '22 22:11

Andy Lorenz