Kendo UI雷达图

时间:2015-08-24 08:42:35

标签: kendo-ui radar-chart

您好我正在尝试制作一个Kendo UI雷达图表。我想知道正确的格式以显示数据。

    { 
        new {year = year, thisyear = new {satisfaction = pq1, organisation=pq2, expecations=pq3, teaching=pq3, consistent=pq4} }                           //cpe            

    };

        Response.Cache.SetCacheability(HttpCacheability.ServerAndPrivate);
        Response.Cache.SetMaxAge(new TimeSpan(24 * 31, 0, 0));
        return Json(radata, JsonRequestBehavior.AllowGet);¨

这是对的吗?

1 个答案:

答案 0 :(得分:0)

您的问题在细节上有点简短,但如果我理解正确,您可以像这样组织您的数据:

var data = [
    {
      "Criteria": "satisfaction ",
      "Y2015": 5,
      "Y2014": 8
    },
    {
      "Criteria": "organisation",
      "Y2015": 8,
      "Y2014": 7
    },
    {
      "Criteria": "expecations",
      "Y2015": 6,
      "Y2014": 9
    },
    {
      "Criteria": "teaching",
      "Y2015": 7,
      "Y2014": 7
    },
    {
      "Criteria": "consistent",
      "Y2015": 5,
      "Y2014": 9
    },
]

$("#chart").kendoChart({
    title: {
        text: "Survey"
    },
    dataSource: data,
    seriesDefaults: {
        type: "radarLine",
        style: "smooth"
    },
    series: [{
        name: "2015",
        field: "Y2015"
    }, {
        name: "2014",
        field: "Y2014"
    }],
    categoryAxis: {
        field: "Criteria"
    },
    valueAxis: {
      max: 10
    },
    theme: "Fiori"
 });
  

<强> DEMO

enter image description here