jqplot tickOptions formatString选项

Gre*_*yer 7 jquery jqplot

我对Web开发人员来说非常新手.我觉得令人沮丧的是选项中使用的axesRendererDefaults选项jqplot.

根据这个链接:

指定刻度线在轴(X或Y)上的显示方式将由该formatString: ''选项指定的内容决定.

有哪些选项可供formatString选择?在jqplot页面上给出的教程中,它们传递选项,例如:%d,$%d%n.如何找到可用选项的完整列表?

这些格式选项是否jqplot与实际属性相分离jQuery

And*_*enz 12

格式命令与sprintf函数的命令类似(如果不相同).

对它们的一个不错的参考是http://perldoc.perl.org/functions/sprintf.html

例如yaxis:{tickOptions:{formatString:'%.2f'}}

将输出一个浮点数到2位小数.


小智 5

http://www.jqplot.com/docs/files/plugins/jqplot-dateAxisRenderer-js.html

Accecptable格式代码是:

Code    Result                  Description
            == Years ==
%Y      2008                Four-digit year
%y      08                  Two-digit year
            == Months ==
%m      09                  Two-digit month
...
Run Code Online (Sandbox Code Playgroud)


小智 0

我相信 formatString 与 Highcharts 使用的相同,并且是 PHP 的 strftime 函数的子集。这是有关它的 Highcharts文档的链接。