How can I set circle size of the pie chart with jqplot?

女生的网名这么多〃 提交于 2020-01-05 07:28:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!