gpt4 book ai didi

kendo-ui - 如何删除剑道图表 y 轴中的小数位

转载 作者:行者123 更新时间:2023-12-02 17:21:54 27 4
gpt4 key购买 nike

我正在尝试在可平移和放大/缩小之后删除剑道图表“Y 轴小数位”

实际加载图表 enter image description here

放大和平移后 enter image description here

如何从 y 轴上删除小数值,我尝试设置“Y 轴标签格式.. 但它不起作用

我试过的代码

 jQuery("#chart_i139_XzCnAHHzIR").kendoChart({
"chartArea": { "background": "#FFFEFC" },
"renderAs": "canvas", "title": { "text": "p1" },
"legend": { "labels": { "template": "#= series.name #" }, "position": "top" },
"series": [{
"name": "Male", "type": "line",
"data": [35171, 36663, 30247, 36479, 34025, 37142, 37295, 36054, 38076, 37725, 34716, 39620, 38296],
"stack": false, "labels": { "format": "{0:n0}", "visible": true, "position": "above" },
"style": "smooth"
}, {
"name": "Female", "type": "line",
"data": [34295, 32586, 36872, 35556, 38839, 36932, 34039, 35055, 35429, 35689, 34528, 31777, 33405],
"stack": false, "labels": { "format": "{0:n0}", "visible": true, "position": "above" },
"style": "smooth"
}], "categoryAxis": [{
"labels": { "rotation": { "angle": "auto" } },
"majorGridLines": { "width": 1, "color": "#dfdfdf", "visible": false },
"line": { "visible": true },
"title": { "text": "years", "position": "left" },
"categories": ["2008", "2007", "2009", "2010", "2011", "2012", "2013", "2014", "2015", "2017", "2016", "2018", "2019"]
}], "valueAxis": [{ "majorGridLines": { "visible": false } }],
"transitions": false,
"tooltip": { "template": "#= series.name #: #= kendo.format(\u0027{0:n0}\u0027,value) #", "visible": true },
"pannable": true, "zoomable": true
});

最佳答案

一个更简单的解决方案是将以下配置附加到图表选项的 valueAxis 字段:

valueAxis: {
labels: {
format: "{0:0}"
}
}

关于kendo-ui - 如何删除剑道图表 y 轴中的小数位,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42086146/

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