自定义Kendo折线图

时间:2015-08-31 07:10:09

标签: kendo-ui kendo-asp.net-mvc kendo-chart

我想按如下方式自定义kendo折线图:

enter image description here

我想在剑道折线图的右侧显示堆积条形图。

有没有办法用MVC实现这个目标

1 个答案:

答案 0 :(得分:0)

除了激光X值之外,条形可以为空值:

  

<强> DEMO

$("#chart").kendoChart({
    title: {
        text: ""
    },
    legend: {
        visible: false
    },
    seriesDefaults: {
        type: "column",
        stack: true
    },
    series: [{
        name: "zone1",
        data: [null, null, null, null, null, null, null, null, null, null, null, null, null, null, 45],
        color: "#f3ac32"
    }, {
        name: "zon2",
        data: [null, null, null, null, null, null, null, null, null, null, null, null, null, null, 25],
        color: "#b8b8b8"
    }, {
        name: "zone3",
        data: [null, null, null, null, null, null, null, null, null, null, null, null, null, null, 30],
        color: "#bb6e36"
    },
    {
        name: "The Line",
        data: [17, 17, 16, 28, 34, 30, 25, 30, 27, 37, 25, 33, 26, 36, 29],
        color: "#111111",
         type: "line"
    }],
    valueAxis: {
        max: 100,
    },
    categoryAxis: {
        categories: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15],
        majorGridLines: {
            visible: false
        }
    },
    tooltip: {
        visible: true,
        template: "#= series.name #: #= value #"
    }
});

或者,您可以将2个图表并排显示,并在值轴上显示相同的最小值和最大值。