admin管理员组文章数量:1293645
Does anyone know how to create an on-click event for the Kendo-UI data viz bar graphs?
I have this graph inside a kendo window, and when you click on one of the bars, I need to swap out the content of the window.
I can't seem to find the right element to attach the click to.....
The kendo code......
<script> // Kendo Chart
function createChart() {
$("#chart").kendoChart({
title: {
text: "Memberships by dddd- dddd"
},
legend: {
visible: true
},
seriesDefaults: {
type: "bar"
},
series: [{
name: "dddd",
data: [123, 42, 76, 344],
color: '#0A9ECC'
}, {
name: "dddd",
data: [76, 970, 23, 14],
color: '#CE1D1D'
},
{
name: "ddddd",
data: [144, 44, 264, 647],
color: '#d2b723'
}],
valueAxis: {
max: 1000,
line: {
visible: false
},
minorGridLines: {
visible: true
}
},
categoryAxis: {
categories: ["Membership 1", "Membership 2", "Membership 3", "Membership 4"],
majorGridLines: {
visible: false
}
},
tooltip: {
visible: true,
template: "#= series.name #: #= value #"
}
});
}
$(document).ready(createChart);
$(document).bind("kendo:skinChange", createChart);
</script>
Does anyone know how to create an on-click event for the Kendo-UI data viz bar graphs?
I have this graph inside a kendo window, and when you click on one of the bars, I need to swap out the content of the window.
I can't seem to find the right element to attach the click to.....
The kendo code......
<script> // Kendo Chart
function createChart() {
$("#chart").kendoChart({
title: {
text: "Memberships by dddd- dddd"
},
legend: {
visible: true
},
seriesDefaults: {
type: "bar"
},
series: [{
name: "dddd",
data: [123, 42, 76, 344],
color: '#0A9ECC'
}, {
name: "dddd",
data: [76, 970, 23, 14],
color: '#CE1D1D'
},
{
name: "ddddd",
data: [144, 44, 264, 647],
color: '#d2b723'
}],
valueAxis: {
max: 1000,
line: {
visible: false
},
minorGridLines: {
visible: true
}
},
categoryAxis: {
categories: ["Membership 1", "Membership 2", "Membership 3", "Membership 4"],
majorGridLines: {
visible: false
}
},
tooltip: {
visible: true,
template: "#= series.name #: #= value #"
}
});
}
$(document).ready(createChart);
$(document).bind("kendo:skinChange", createChart);
</script>
Share
Improve this question
asked Feb 9, 2014 at 15:25
MarkMark
4,8838 gold badges56 silver badges93 bronze badges
1 Answer
Reset to default 8I think you are looking for the seriesClick event.
$(".k-chart")
.data("kendoChart")
.bind("seriesClick", function (e) { console.log(e); })
本文标签: javascriptKendo UI ChartClick EventsStack Overflow
版权声明:本文标题:javascript - Kendo UI Chart - Click Events - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741582702a2386664.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论