使用jquery显示两个饼图之间的区别?

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

标签: jquery jqplot

WORKING DEMO

jQuery(document).ready(function() {
            var firstv=10;
            var secondv=20;
            var thirdv=70;
            var name1="ram";
            var name2="kumar";
            var name3="manju";
    var data = [[name1, firstv],[name2, secondv],[name3,thirdv]];

var plot1 = jQuery.jqplot('chart', [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,                                
            }
        });
      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,                                
            }
        });
});

我需要显示第三个饼图,显示两个图表之间的差异 第一个饼图

ram=10;
kumar=20;
manju=70;

第二个饼图

giri=30;
shiva=40;
nanda=30;

现在我需要的输出是

 giri 30 =ram 10 + kumar 20 //
shiva 40 = manju 40;
nanda 30 = manju 30;

如何使用jqplot和jquery

实现此目的

我到目前为止所尝试的是

0 个答案:

没有答案