是否有一种简单的方法可以在 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>