[英]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.