剑道堆叠条形图配置



我有一个MVC应用程序,我的控制器正在传递以下json数据到我的视图

data:
{
    "Category":"Q1 2013",
    "Name":"Female",
    "Count":5000
},
{
    "Category":"Q1 2013",
    "Name":"Male",
    "Count":5000
}
{
    "Category":"Q1 2012",
    "Name":"Female",
    "Count":3500
},
{
    "Category":"Q1 2012",
    "Name":"Male",
    "Count":5000
}

我需要知道如何配置我的剑道堆叠条形图来显示这样的数据http://jsfiddle.net/ihatemash/B6LSX/

我不知道如何配置系列和类别来正确显示堆叠条形图

这里是一个工作示例http://jsfiddle.net/idhasitha/F2TQ8/

try with like this

var data = [
    {"Name":1,"Year":2011,"Expense":200.00},
    {"Name":1,"Year":2012,"Expense":274.91},
    {"Name":5,"Year":2011,"Expense":100.00},
    {"Name":5,"Year":2012,"Expense":315.84},
];
$(document).ready(function() {
    $("#chart").kendoChart({
        theme: "silver",
        title: {
            text: "Total records processed"
        },
        legend: {
            position: "bottom"
        },
        dataSource: {
            data: data,
            group: {
                field: "Name"
            }
        },
        transitions: false,
        series: [{
            type: "column",
            stack: "true",
            field: "Expense"
        }],
        categoryAxis: {
            field: "Year"                                
        }
    });
});

相关内容

  • 没有找到相关文章

最新更新