是否有無法在折線圖中隱藏零(0)值的數據點?我目前正在使用折線圖(劍道),似乎無法找到一個簡單的方法來做到這一點。基本上,一條線顯示在圖上的0值處,而我根本不顯示線。數據綁定的行結束值之一是零(我必須將其刪除)。示例數據如[30,50,40 ,75.0]在折線圖中隱藏零值Kendo ui
在這裏,我提供的HTML代碼
$.ajax({
type: "POST",
contentType: "application/json;charset=utf-8",
url: "dataVizWebService.asmx/GetSellInOfficeTrends",
dataType: "json",
success: function (data) {
$("#chart").kendoChart({
dataSource: {
data: data.d,
value: "#={0}>0"
},
legend: {
position: "bottom"
},
title: {
text: "Population"
},
series: [
{
type: "line",
field: "Population2010",
name: "Population2010",
axis: "Year",
color: "#4a7ebb"
}, {
type: "line",
field: "Population2011",
name: "Population2011",
axis: "Year",
color: "#be4b48"
}, {
type: "line",
field: "Population2012",
name: "Population2012",
axis: "Year",
color: "#98b954"
}, {
type: "line",
field: "Population2013",
name: "Population2013",
axis: "Year",
dashType: "dash",
color: "#000000"
}
],
valueAxis: [{
name: "Year",
title: { text: "Population in Millions" }
}],
categoryAxis: {
field: "Week",
majorTickType: "none",
labels: {
skip: 0
}
},
tooltip: {
visible: true
}
})
}
});
任何幫助將不勝感激。
感謝您的回覆,這裏我有四行系列,數據來自數據庫中的五列(第一是WeekName,2nd Population2010,Population2011,Population2012,Population2013)價值zero.that價值線(零點)我想隱藏/刪除它。 –
是否有可能將值返回爲null?這將是更多的語義,並將允許您使用http://docs.kendoui.com/api/dataviz/chart#seriestype--line-missingvalues-stringdefault選項 –
對不起,遲到response.I已嘗試給出的鏈接,但顯示帶有零線的圖表。 –