Php jqplot未在条形图上显示值标签
我尝试使用jqplot来绘制条形图,我发现了图形中第一个条形图的问题,它不是显示点标签。如何解决这个问题?谢谢你的帮助和建议 洛凯奥 对不起,我忘了Php jqplot未在条形图上显示值标签,php,jquery,jqplot,Php,Jquery,Jqplot,我尝试使用jqplot来绘制条形图,我发现了图形中第一个条形图的问题,它不是显示点标签。如何解决这个问题?谢谢你的帮助和建议 洛凯奥 对不起,我忘了 <script type="text/javascript"> $(document).ready(function() { var s1 = [32100,0,0,990000,0,0,0,0,0,0,0,0]; var s2 = [36000,0,0,1800,0,4980,0,0,0,0,0,0];
<script type="text/javascript">
$(document).ready(function() {
var s1 = [32100,0,0,990000,0,0,0,0,0,0,0,0];
var s2 = [36000,0,0,1800,0,4980,0,0,0,0,0,0];
var s3 = [0,0,0,0,0,0,0,0,0,0,0,0];
var ticks = ['1 2013','2 2013','3 2013','4 2013','5 2013','6 2013','7 2013','8 2013','9 2013','10 2013','11 2013','12 2013'];
$('#show-graph').css('height', '699px').jqplot([s1, s2, s3], {
title:'รายจ่าย',
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
rendererOptions: {
barWidth: 20,
barMargin: 10
},
pointLabels: {
show: true,
formatString: "%#.2f",
hideZeros: true
}
},
axes:{
xaxis:{
renderer: $.jqplot.CategoryAxisRenderer,
tickRenderer: $.jqplot.CanvasAxisTickRenderer ,
tickOptions: {
fontFamily: 'Georgia',
fontSize: '10pt',
angle: -30,
labelPosition: 'middle'
},
ticks: ticks
},
yaxis: {
min: 0
}
},
legend: {
show: true,
location: 'ne',
placement: 'insideGrid'
},
series:[
{label: 'beverage'},
{label: 'equipment'},
{label: 'another'}
]
});
});
$(文档).ready(函数(){
变量s1=[32100,0,0990000,0,0,0,0,0,0,0];
var s2=[36000,0,01800,04980,0,0,0,0,0];
var s3=[0,0,0,0,0,0,0,0,0,0,0];
风险值节拍=['2013年1月'、'2013年2月'、'2013年3月'、'2013年4月'、'2013年5月'、'2013年6月'、'2013年7月'、'2013年8月'、'2013年9月'、'2013年10月'、'2013年11月'、'2013年12月];
$(“#显示图形”).css('height','699px').jqplot([s1,s2,s3]{
标题:'รายจ่าย',
系列默认值:{
渲染器:$.jqplot.blunderer,
渲染器选项:{
条宽:20,
边距:10
},
点标签:{
秀:没错,
formatString:“%#.2f”,
希德泽罗斯:是的
}
},
轴线:{
xaxis:{
渲染器:$.jqplot.CategoryAxisRenderer,
tickRenderer:$.jqplot.CanvasAxisTickRenderer,
选择:{
fontFamily:“格鲁吉亚”,
字体大小:“10pt”,
角度:-30,
标签位置:'中间'
},
滴答声:滴答声
},
亚克斯:{
最低:0
}
},
图例:{
秀:没错,
位置:'ne',
位置:“insideGrid”
},
系列:[
{标签:'饮料'},
{标签:'设备'},
{标签:'另一个'}
]
});
});
这是因为最左边的条太靠近边缘,因此jqPlot不会渲染该条。试着增加宽度
$jqplot('show-graph', [s1, s2, s3], {
title: 'xxxx',
width: 1000,
....
}
可能是绘图配置问题,代码在哪里?这是因为最左边的条形图太靠近边缘,因此jqplot不会渲染该边。试着向右转一点。谢谢sza,如何向右转?我知道这是一篇老文章,但我在这里遇到了同样的问题。找到了解决方案。