我正在使用jqplot来绘制饼图。但是,当我绘制一个包含变量100%的数据的饼图时,它会显示一个非常奇怪的饼图。饼图jqplot为100%时的正方形
这是我的代码
<script type="text/javascript">
$(document).ready(function()
{
$('#chart1').bind('jqplotDataHighlight',
function (ev, seriesIndex, pointIndex, data)
{
$('#info1').html('' + data[0] + " - " + data[1]);
}
);
$('#chart1').bind('jqplotDataUnhighlight',
function (ev) {
$('#info1').html(' ');
}
);
var plot1 = jQuery.jqplot ('chart1', [data],
{
title: {
text: '', // title for the plot,
show: true,
},
seriesDefaults: {
renderer: jQuery.jqplot.PieRenderer,
padding: 0,
color:"#FFFFFF",
shadow: false,
rendererOptions: {
dataLabelFormatString: "<font color=white>%d%</font>",
diameter: 135,
showDataLabels: true,
sliceMargin: 1,
textColor: "#ABBBBB",
lineWidth: 5
},
},
legend: {
show:true, location: 'e'
},
grid: {
background: '#ffffff',
shadow: false,
borderWidth: 0
}
}
);
});
</script>
我认为如果你没有很好地解释,你不会得到太多的答案。通常读者认为关于这个问题的所有细节都在帖子主体本身上,并且不会试图从帖子主体的标题和其他一半中获取一半,并且理解这个问题。至少包括你用来做这件事的代码。 –
“数据”数组的内容是什么? –
它是工具提示,就像Android - 123设备 –