我正在使用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設備 –