跳至内容
菜单
此问题已终结
2858 查看

I want to add a click event in chart, here is my js code,

    render_top_customer_graph:function(){
var self = this
var ctx = self.$(".top_user");
rpc.query({
model: "request.request",
method: "get_the_top_customer",
}).then(function (arrays) {


var data = {
labels: arrays[1],
datasets: [
{
label: "Ticket Count",
data: arrays[0],
backgroundColor: [
"rgba(255, 99, 132,1)",
"rgba(54, 162, 235,1)",
"rgba(75, 192, 192,1)",
"rgba(153, 102, 255,1)",
"rgba(10,20,30,1)"
],
borderColor: [
"rgba(255, 99, 132, 0.2)",
"rgba(54, 162, 235, 0.2)",
"rgba(75, 192, 192, 0.2)",
"rgba(153, 102, 255, 0.2)",
"rgba(10,20,30,0.3)"
],
borderWidth: 1
},

]
};

//options
var options = {
responsive: true,
title: {
display: true,
position: "top",
text: "Helpdesk User vs Requests",
fontSize: 18,
fontColor: "#121"
},
legend: {
display: true,
position: "bottom",
labels: {
fontColor: "#333",
fontSize: 16
}
},
scales: {
yAxes: [{
ticks: {
min: 0
}
}]
}
};

//create Chart class object
var chart = new Chart(ctx, {
type: "horizontalBar",
data: data,
options: options,
});
});
},
xml file:













形象
丢弃
相关帖文 回复 查看 活动
0
4月 21
1644
1
5月 25
3986
1
5月 24
2981
1
4月 24
26553
1
5月 23
3589