jqplot的x轴自动渲染的情况下,如果数字太小会出现小数,今天找了一手册终于找到如何设置了
<script type="text/javascript" src="/jui/jqplot/jquery.jqplot.min.js"></script>
<script type="text/javascript" src="/jui/jqplot/plugins/jqplot.canvasTextRenderer.min.js"></script>
<script type="text/javascript" src="/jui/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js"></script>
//标注详细值
<script type="text/javascript" src="/jui/jqplot/plugins/jqplot.pointLabels.min.js"></script>
//x轴按我们设定的渲染
<script type="text/javascript" src="/jui/jqplot/plugins/jqplot.categoryAxisRenderer.min.js"></script>
var line1 = [];
line1[0]=["1月", 7, 7];
line1[1]=["2月", 14, 14];
jQuery.jqplot('chart1', [line1],
{
title:'订单统计',
seriesDefaults: {
showMarker:true,
pointLabels:{ show:true }
},
axesDefaults: {
tickRenderer: jQuery.jqplot.CanvasAxisTickRenderer
},
axes:{
xaxis: {
renderer: jQuery.jqplot.CategoryAxisRenderer
},
yaxis: {
autoscale:true
}
}
});
效果图如下: