Я использую 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>