admin管理员组文章数量:1419168
I'm trying to display category labels on the x-axis on a bar chart but can't work out how to do this. Here's the HTML and JS:
<!DOCTYPE html>
<html xmlns="">
<head>
<title></title>
</head>
<body>
<div id="chart"></div>
<script src="js/thirdParty/jquery.js"></script>
<script src="js/thirdParty/kendo.all.min.js"></script>
<script>
$(function () {
$("#chart").kendoChart({
legend: {
visible: false
},
seriesDefaults: {
type: "column"
},
series: [{
name: "Category A",
data: [5]
}, {
name: "Category B",
data: [20]
}, {
name: "Category C",
data: [10]
}],
})
});
</script>
</body>
</html>
The following screen shot highlights in a red box where I am trying to put the labels:
Any help would be appreciated.
I'm trying to display category labels on the x-axis on a bar chart but can't work out how to do this. Here's the HTML and JS:
<!DOCTYPE html>
<html xmlns="http://www.w3/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div id="chart"></div>
<script src="js/thirdParty/jquery.js"></script>
<script src="js/thirdParty/kendo.all.min.js"></script>
<script>
$(function () {
$("#chart").kendoChart({
legend: {
visible: false
},
seriesDefaults: {
type: "column"
},
series: [{
name: "Category A",
data: [5]
}, {
name: "Category B",
data: [20]
}, {
name: "Category C",
data: [10]
}],
})
});
</script>
</body>
</html>
The following screen shot highlights in a red box where I am trying to put the labels:
Any help would be appreciated.
Share Improve this question asked Aug 17, 2013 at 12:15 Carl RipponCarl Rippon 4,6739 gold badges53 silver badges66 bronze badges2 Answers
Reset to default 4In your case, you have provided 3 series. if you were intention was to create single series with three different X plot points, then the right way to do that is as below:
$("#chart2").kendoChart({
legend: {
visible: true
},
seriesDefaults: {
type: "column"
},
series: [{
data: [5,10,20]
}],
categoryAxis: [{
categories: ["Category A", "Category B","Category C"]
}]
});
What I have done is - I have said that Xaxis will have 3 plot points and the series contains a single array data with 3 y plot points.
here is the JSBin - http://jsbin./aroquki/1/edit
Hope this helps.
You see, this example will solve your problem.
JSbin Code
Document kendo Chart
本文标签: javascriptCategory labels on a kendo UI bar chartStack Overflow
版权声明:本文标题:javascript - Category labels on a kendo UI bar chart - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745304525a2652565.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论