0

I have the following codes below:

$("#scaledScore").kendoChart({
        dataSource: chartData(),     // return array list.
        series: [
            {
                type: "bar",
                field: "StudentScore",
                name: "Student's score"
            }
        ],
        valueAxis: {
            field: "SchoolScore"
        },
        categoryAxis: {
            field: "Description"
        }
    });

function chartData(){
    var sampleData = new Array();

    sampleData[0] = {
        Description : "Math",
        StudentScore: 45,
        Subject: Math
    };

    sampleData[1] = {
        Description : "Science",
        StudentScore: 60,
        Subject: Science
    };

    sampleData[2] = {
        Description : "English",
        StudentScore: 45,
        Subject: English
    };

    return sampleData;
}

The above codes will render a bar chart with (three) bars for (Math, Science, and English) as expected. But what I want is to have a single bar ONLY for (Math, Science and English). Say Math value will have a RED color, Science will have GREEN and English will have BLUE.

Is that possible?

FYI: Stacked Bar will not work for me.

Thanks

4

1 回答 1

0

我认为堆叠条是您想要的。如果这不起作用,也许我们的起点应该是您的非工作堆叠条示例代码?

于 2014-10-01T01:32:41.087 回答