如何使一致的圆环图半径相同

时间:2015-04-17 13:14:03

标签: javascript jquery donut-chart

以下输出我得到了:

使用Charisma Library使用以下代码实现我的甜甜圈图表

$(document).ready(function(){
    var data = [];
    var opportunities_colors = new Array(); 
    opportunities_colors["New"] =  "#999999"; 
    opportunities_colors["Inprogress"] =  "#dd5600"; 
    opportunities_colors["Complete"] =  "#73a839"; 
    opportunities_colors["Terminate"] =  "#c71c22"; 
    opportunities_colors["Reopen"] =  "#c71c22";

    var opportunities_colors_option = new Array(); 
    // alert("opportunities_colors="+opportunities_colors["New"]);

    var i=0;
    $("#opportunities_dropdown_id option").each(function()
            {
            data[i] = {};               
            data[i].label =  $(this).text(); 
            opportunities_colors_option.push(opportunities_colors[$(this).text()]);
            data[i].data = $(this).val();
            i++;
            });

    //donut chart
    if ($("#opportunities_donutchart").length) {
        $.plot($("#opportunities_donutchart"), data,
            {
            // colors: ["green", "red", "blue", "orange", "cyan"],
            colors: opportunities_colors_option,

                series: {
                    pie: {
                        innerRadius: 0.5,
                        show: true
                    }
                },
                legend: {
                    show: false
                }
            });
    }
});

我得到的输出,

Image Description

请帮助使两个图表的半径相同

0 个答案:

没有答案