[英]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.com/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.