我正在尝试在我正在呈现的图表上添加点击事件。从 chart.click 到 chart.on('click', function (e){ })。
我想要做的是允许用户选择图表上的点,对我来说现在用户做了什么选择。使用 chartist.js 有可能吗?
我通读了文档:CHARTIST.JS
我的代码:
if (item.GraphType.Description == "Line") {
var chart = new Chartist.Line(
container[0],
{
labels: d.Labels,
series: d.SeriesData
},
{
axisY: {
offset: 60
}
}
);
chart.click(function (e) {
console.log(e);
});
}