[英]jqplot number of the week of the year
我試圖在xAxis上顯示一年中的星期幾,所以這是我的代碼,但是它不起作用
$.jqplot('my_canvas' + id, data, {
title: 'Graphic',
xaxis: {
renderer : $.jqplot.DateAxisRenderer,
min: from_date,
label: "WEEK",
tickInterval: '1 week',
tickOptions:{
formatter: Formatter //why formatter is not not being called?
}
},
yaxis: {
min: 0,
max: maximum_value
}
highlighter: {
show: true
}
}
Formatter = function (format, val) {
return numberOftheWeek(val);
}
使用renderer時不會調用formatter :$ .jqplot.DateAxisRenderer,但是當我使用renderer時:$ .jqplot.CategoryAxisRenderer。 它被調用,但是所有aAxis標簽都被疊加。
所有幫助將不勝感激。 謝謝!
試試這個,不確定是否有效:
xaxis: {
renderer:$.jqplot.DateAxisRenderer,
label: "WEEK",
min: from_date,
tickInterval: '1 WEEK',
tickOptions: {formatString:Formatter, markSize: 4},
},
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.