将两个饼图合并或分组到一个饼图中

时间:2012-09-18 15:57:42

标签: jquery jqplot

JSFIDDLE

如何使用jqplot将两个饼图合并为一个饼图

var firstv=30;
            var secondv=40;
            var thirdv=30;
            var name1="giri";
            var name2="shiva";
            var name3="nanda";
    var data =  [[name1, firstv],[name2, secondv],[name3,thirdv]];

var plot1 = jQuery.jqplot('chart1', [data],
        {
            grid: {
                shadow: false,
                background: '#FFFFFF',                                                                                          
            },
            seriesDefaults: {
                // Make this a pie chart.
                renderer: jQuery.jqplot.PieRenderer,
                rendererOptions: {
                    showDataLabels: true,
                    padding: 20,
                    startAngle: 270
                }
            },
            legend: {
                show: true,
                location: 'e',
                fontSize: 11,
                marginTop: 10,                                
            }
        });

0 个答案:

没有答案