简体   繁体   English

使用KendoUI折线图,如何保持条形点的连接? (参见图片)

[英]Using KendoUI Line Chart, How can keep bar dots connected? (See Image)

I'm using KendoUI to replace some DotNet Charting Graphs. 我正在使用KendoUI替换一些DotNet图表。 How do I keep the line connected even when there is no data? 即使没有数据,如何保持线路连接?

The first chart is the Dot Net Charting which is being replaced. 第一个图表是要替换的点网图表。 The second chart is the KendoUI which I'd like to keep the dots connected. 第二张图表是KendoUI,我想保持点之间的联系。

My html looks like this: 我的html看起来像这样:

My jQuery Kendo Script for the following chart looks like: 我的jQuery Kendo脚本如下图所示:

jQuery('#chart').kendoChart({
    title: {
        text: "Overall Score out of 100",
        align: "left",
        font: "18px Arial, Verdana, sans-serif"
    },
    seriesDefaults: {
        type: "line"
    },
    legend: {
        position: "bottom"
    },
    tooltip: {
        visible: true,
        format: "{0}%"
    },
    valueAxis: {
        min: 70,
        max: 85,
        plotBands: [{
            from: 70,
            to: 75,
            color: "#EDF5FF"},
        {
            from: 80,
            to: 85,
            color: "#EDF5FF"}]
    },
    series: [{
        name: "Some Product",
        color: "004990",
        tooltip: {
            visible: true,
            template: "<b>Some Product *</b><br/>Current Score: #= value #<br/>#= category # "
        },
        data: [81.82, 81.82, 81.82, null, null, null, null, null, null, null, null, 70.42, 72.37]},
    {
        name: " Some Market Segmemt",
        color: "da7633",
        tooltip: {
            visible: true,
            template: "<b> Some Market Segment</b><br/>Current Score: #= value #<br/>#= category # "
        },
        data: [73.81, 73.52, 73.59, 73.49, 73.41, 73.51, 73.72, 73.27, 74.23, 73.99, 73.97, 73.83, 73.79]}],
    categoryAxis: {
        labels: {
            rotation: -45
        },
        categories: ["Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jan - 2012", "Feb", "Mar"]
    }
});

This is a link to JSFittle project with the graph to play with: http://jsfiddle.net/rodneyhickman/uMTnh/1/ 这是指向JSFittle项目的链接,其中包含要使用的图形: http : //jsfiddle.net/rodneyhickman/uMTnh/1/

Here you go: http://jsfiddle.net/LyndsySimon/KJuDe/ 在这里,您可以: http : //jsfiddle.net/LyndsySimon/KJuDe/

You need to use the missingValues: 'interpolate' option on the series configuration. 您需要在系列配置中使用missingValues: 'interpolate'选项。

I found this answer on this page of the Kendo documention: http://www.kendoui.com/documentation/dataviz/chart/configuration.aspx 我在Kendo文档的以下页面上找到了这个答案: http : //www.kendoui.c​​om/documentation/dataviz/chart/configuration.aspx

EDIT: I didn't see your config, somehow. 编辑:某种程度上,我没有看到您的配置。 Here it is, patched up to fill gaps on all series - 在这里,补上所有系列的空白-

jQuery('#chart').kendoChart({
title: {
    text: "Overall Score out of 100",
    align: "left",
    font: "18px Arial, Verdana, sans-serif"
},
seriesDefaults: {
    type: "line",
    missingValues: "interpolate"
},
legend: {
    position: "bottom"
},
tooltip: {
    visible: true,
    format: "{0}%"
},
valueAxis: {
    min: 70,
    max: 85,
    plotBands: [{
        from: 70,
        to: 75,
        color: "#EDF5FF"},
    {
        from: 80,
        to: 85,
        color: "#EDF5FF"}]
},
series: [{
    name: "Some Product",
    color: "004990",
    tooltip: {
        visible: true,
        template: "<b>Some Product *</b><br/>Current Score: #= value #<br/>#= category # "
    },
    data: [81.82, 81.82, 81.82, null, null, null, null, null, null, null, null, 70.42, 72.37]},
{
    name: " Some Market Segmemt",
    color: "da7633",
    tooltip: {
        visible: true,
        template: "<b> Some Market Segment</b><br/>Current Score: #= value #<br/>#= category # "
    },
    data: [73.81, 73.52, 73.59, 73.49, 73.41, 73.51, 73.72, 73.27, 74.23, 73.99, 73.97, 73.83, 73.79]}],
categoryAxis: {
    labels: {
        rotation: -45
    },
    categories: ["Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jan - 2012", "Feb", "Mar"]
}
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用chartJS显示连接点的折线图 - Display line chart with connected dots using chartJS 使用KendoUI折线图,如何使数据标记(点)成为纯色? - Using KendoUI Line Chart, How to make the data markers (Dots) a solid color? 具有空值的折线图:如何保持折线连接? - Line Chart with null values: How to keep Lines connected? Google图表线:如何使用连续轴正确连接点 - Google chart line: how to connect dots properly using a continuous axes 如何在KendoUI条形图中使条形图成为不同的颜色? - How do you make a bar a different color in KendoUI bar chart? 使用KendoUI折线图,如何在类别上附加多个线标签? - Using KendoUI Line Chart, How do you attach multiple Line Labels on Categories? 如何仅使KendoUI dataviz折线图中的最后一个标记可见? - How can I make only the last marker in a KendoUI dataviz line chart visible? 如何在d3折线图中的线上创建点(散点图) - how to create dots(scatterplot) on a line in a d3 line chart 为什么我的KendoUI图表会更改甚至没有连接的javascript变量中的日期格式? 以及如何使其停止? - Why is my KendoUI Chart changing the date format in a javascript variable it's not even connected to? And how to make it stop? 如何仅查看图表图像 - How to See Only the Image of Chart
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM