是否有一种简单的方法可以在沿x轴(版本0.7)的jQuery图形工具“flot”中显示带有前导(左边填充)零的一位数月/日期?
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>