4

在此处输入图像描述如何使用 Html5 和 kendo UI 在折线图中绘制垂直线?谁能帮我解决这个问题?

4

3 回答 3

4

尝试这个:

// let chart be the id
$("#chart").kendoChart({
     categoryAxis: {
         notes: {
             line: {
                 length: 300
             },
             data: [{
                 value: new Date(2012, 0, 3),
                 label: {
                     text: "-" //text you want to show
                 } 
             }]
         }
     }
 });

演示:http: //jsbin.com/obuweca/26

/ * 没有圆圈 * /

$("#chart").kendoChart({
    categoryAxis: {
        notes: {
            line: {
                length: 300
            },
            icon: {
                border: {
                    width: 0
                }
            },
            // Initial notes
            data: [{
                value: new Date(2012, 0, 3)
            }]
        }
    }
});

演示:http: //jsbin.com/obuweca/29/

于 2014-02-25T12:51:29.870 回答
1

在剑道文档中是如何在图表上绘制自定义线条的示例。水平和垂直。

http://docs.telerik.com/kendo-ui/controls/charts/how-to/custom-plot-bands

您可以通过编辑笔画来自定义线条:

 stroke: {
          color: "red",
          width: 1,
          dashType:"dash"
        }
于 2016-09-22T06:53:42.610 回答
0

您也可以尝试使用柱状图。

只需扩展系列:

  series: [{
                type: "line",
                field: "value",
                categoryField: "date"
            },
            {
                type:"column", 
                field: "valueColumn", 
                gap: 300
            }]

以及带有新字段的 dataSource.data,例如:valueColumn。

另请参见示例

于 2015-08-25T11:25:58.130 回答