我製作了一個頁面,以每週的數字繪製平均積雪。現在我們進入了2010年,第1周我的圖形在x軸(年周)上延伸了間隔。 我想要的是x軸上的週數(51,52,1,2等)和固定的間隔寬度。 任何人都知道該怎麼做?jquery flot和週數
<script id="source" language="javascript" type="text/javascript">
$(function() {
var d1 = [
[201001,118],[200952,112],[200951,102],[200950,97],[200949,93],
[200948,41],[200947,10],[200947,0]];
var d2 = [
[201001,33],[200952,31],[200951,31],[200950,25],[200949,23],
[200948,12],[200947,0],[200947,0]];
$.plot($("#placeholder"),
[{data:d1,lines:{show: true},
points:{show: true},label:"Mountain"},
{data:d2,lines:{show: true},points:{show: true},label:"Valley"}],
{xaxis: {tickSize:1, tickDecimals:0 }}
);
});
</script>
我們現在正在2009/2010的第53周,因爲不是所有年份都恰好適合52周,所以本週不能跳過。 – Esko 2010-01-03 12:28:06
我知道它提供了有關X軸在文檔中可以做的更多細節,因爲我不認爲這是我在評論中提供的實際「答案」。 – 2010-05-30 07:54:35
重複http://stackoverflow.com/questions/1994796/jquery-flot-and-week-numbers我認爲。 – 2010-05-30 08:12:20