问题
I ned to set the circle size for pie chart with jqplot....I have following code snippet...
var plot = jQuery.jqplot ('chart', [data],
{
seriesDefaults: {
renderer: jQuery.jqplot.PieRenderer,
rendererOptions: {
showDataLabels: true
},
pointLabels: { show: true }
},
diameter : 1,
legend: {
show:true,
location: 'e',
placement: 'inside'
},
title: {
fontSize:'14px',
fontWeight: 'bold',
fontFamily: 'Arial',
show: true
}
}
is this the right way to set diameter for the circle?
回答1:
It should be under the seriesDefault.renderOptions.diameter
. See their documention at http://www.jqplot.com/docs/files/jqPlotOptions-txt.html
seriesDefaults: {
rendererOptions: {
diameter: 1, // diameter of pie, auto computed by default.
}
}
回答2:
set diameter under rendererOptions.....
var plot = jQuery.jqplot ('chart8', [xyOrgIP],
{
seriesDefaults: {
renderer: jQuery.jqplot.PieRenderer,
rendererOptions: {
showDataLabels: true,
diameter : 100
},
pointLabels: { show: true }
},
legend: {
show:true,
location: 'e',
placement: 'inside'
},
title: {
text: 'Traffic Analysis by Origin IP (Last 7 Days)', // title for the plot,
fontSize:'14px',
fontWeight: 'bold',
fontFamily: 'Arial',
show: true
}
}
来源:https://stackoverflow.com/questions/26503417/how-can-i-set-circle-size-of-the-pie-chart-with-jqplot