【发布时间】:2014-06-18 00:58:48
【问题描述】:
我正在使用 Jqplot 堆积条形图。它工作正常,但问题在于点标签重叠的黄色和蓝色条的小值。
有人可以帮我解决这个问题,以显示我的两个点标签,两个值不重叠吗?
用于重绘统计条形图的 Jqplot 选项
ticks =['Jan 14', 'Feb 14', 'Mar 14', 'Apr 14', 'May 14', 'Jun 14', 'Jul 14', 'Aug 14', "Sep 14", 'Oct 14', 'Nov 14', 'Dec 14'];
var s1 = [73, 112, 307, 849, 1591, 1016, 647, 445, 60, 30, 10, 1];
var s2 = [4338, 5114, 3484, 2282, 89, 35, 8, 3, 2, 1, 1, 0];
plot3 = $.jqplot('chart3', [s1, s2], {
// Tell the plot to stack the bars.
seriesColors: [ "rgb(255, 78, 80) ", "rgb(29, 171, 54)"],
animate: !$.jqplot.use_excanvas,
stackSeries: true,
captureRightClick: true,
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
rendererOptions: {
// Put a 30 pixel margin between bars.
barMargin: 30,
highlightMouseDown: true
},
pointLabels:{ show:true, stackedValue: false }
},
series:[
{label:'Inflight'},
{label:'Completed'}
],
axes: {
xaxis: {
ticks: ticks,
renderer: $.jqplot.CategoryAxisRenderer
},
yaxis: {
padMin: 0
}
},
legend: {
show: true,
location: 'n'/*,
placement: 'outside'*/
}
});
【问题讨论】:
-
你能显示用于绘制图表的选项吗?
-
我附上了用于绘制图表的绘图选项。
-
将文字旋转-45度,见下面我的回答。
标签: javascript jquery jqplot bar-chart