繁体   English   中英

确定浮点图

[英]Determine plot of flot point

我有一个带有一些不同曲线的浮点图。 在将鼠标悬停在某个点上时,会交互触发一个事件,例如http://www.flotcharts.org/flot/examples/interacting/ 是否有任何简便的方法可以确定事件点来自哪个绘图,而无需唯一地为所有绘图着色并获得该点的颜色?

如果您查看该页面上的脚本,则具有plothover事件的此绑定:

$("#placeholder").bind("plothover", function (event, pos, item) 

item是您要悬停的实际点(如果未悬停在某个点,则为null)。 该对象包含你需要既包括了所有的数据series ,让你所属的系列(我假设是您的意思plot )和seriesIndex

item对象的实际描述有点隐藏在文档中

item: {
    datapoint: the point, e.g. [0, 2]
    dataIndex: the index of the point in the data array
    series: the series object
    seriesIndex: the index of the series
    pageX, pageY: the global screen coordinates of the point
}

另请注意:“此示例中的item对象为null或表单上的附近对象”

“附近”附近的距离取决于mouseActiveRadius

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM