有没有一种简单的方法来显示一个数字的月份/日期,并在jQuery图形工具"flot“中沿x轴(0.7版)显示一个前导(左填充)的零?
xaxis: { mode: "time", timeformat: "%y-%m-%d/", TickSize: [1, "day"]}以2012-9-5为例,最好是2012-09-05
更多的代码...
<div id="placeholder" style="width:900px;height:200px;"></div>
<script>
$(function () {
var d = [<?php echo $qforgraph; //[1203894000000, 288]
?>];
var options = {
lines: { show: true },
points: { show: true },
xaxis: { mode: "time", timeformat: "%y-%0-%0", minTickSize: [1, "month"]},
grid: { backgroundColor: { colors: ["#FFF", "#EEF"] } }
};
var plot = $.plot($("#placeholder"), [d], options);
});
</script>发布于 2013-02-21 09:21:18
您使用的是0.7版吗?在master中,默认情况下月份和天数是零填充的。
https://stackoverflow.com/questions/14985314
复制相似问题