0
我無法獲得flot來註冊我發送的自定義ticks。我的代碼工作正常,但滴答仍然出現,因爲無論選擇默認的滴答。js plotting library flot中的自定義ticks
HTML:
<div class="flot" id="flotcontainer"></div>';
JS:
var $hist_data = [[1.0, 0],[2.0, 2],[3.0, 1],[4.0, 1],[5.0, 0],[6.0, 1],[7.0, 2],[8.0, 1],[9.0, 1],[10.0, 1]];
var $hist_ticks = [[1.0, 1.0],[2.0, 2.0],[3.0, 3.0],[4.0, 4.0],[5.0, 5.0],[6.0, 6.0],[7.0, 7.0],[8.0, 8.0],[9.0, 9.0],[10.0, 10.0]];
<script type="text/javascript">
$.plot($("#flotcontainer"),
[
{
data: $hist_data,
bars: { show: true, barWidth: 1, fill:0.8},
color: "#227dda",
xaxis: {ticks: $hist_ticks}
}
]
);
</script>
釘吧!謝謝 –