gpt4 book ai didi

jquery - jQuery Flot "plotclick"事件中获取点击标签

转载 作者:行者123 更新时间:2023-12-03 22:49:42 25 4
gpt4 key购买 nike

所以我有一个 jQuery 方法来捕获 Flot 图表上的点击事件:

$("#placeholder").bind("plotclick", function (event, pos, item) {
alert("clicked");
});

我知道 item['datapoint'] 数组中的单击值。但是我在哪里可以找到我点击的曲线的标签呢?

谢谢。

最佳答案

查看item.series.label:

$("#placeholder").bind("plotclick", function (event, pos, item) {
if (item) {
alert(item.series.label);
}
});

fiddle here .

关于jquery - jQuery Flot "plotclick"事件中获取点击标签,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15836044/

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