gpt4 book ai didi

jquery - 隐藏折线图中的零值 Kendo ui

转载 作者:行者123 更新时间:2023-12-01 03:45:18 25 4
gpt4 key购买 nike

是否有办法隐藏折线图中零 (0) 值的数据点?我目前正在使用折线图(Kendo),似乎找不到一种简单的方法来做到这一点。基本上,一条线显示在图表上的 0 值处,我宁愿根本不显示该线。数据绑定(bind)线结束值之一为零(我必须删除它)。示例数据如 [30,50,40 ,75,0]

这里我提供了 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
}
})
}
});

任何帮助将不胜感激。

最佳答案

Kendoui API 文档中存在缺失值属性。您可以使用这些属性并检查哪些对您有用。

关于jquery - 隐藏折线图中的零值 Kendo ui,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14151445/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com