我在哪里可以找到 plothover 函数中 'item' 的属性列表?

Where can I find a list of properties for 'item' in plothover function?

所以我有这个功能:

 $.fn.UseTooltip = function () {
        $(this).bind("plothover", function (event, pos, item) {
            if (item) {
             ......

                item.pageX, item.pageY, item.series.data, item.dataIndex...

我想知道哪里有所有项目属性的列表。谢谢!

文档中没有完整的属性列表。但是您可以通过检查浏览器开发人员工具中的 item 对象来获取属性(通过设置断点或使用 console.log(item); 在控制台中输出项目)。

结果是这样的(取决于使用的插件和情节的选项):

{
   [functions]: ... ,
   dataIndex: 3,
   datapoint: [
      0: 2006,
      1: 5907,
      2: 0,
      length: 3
   ],
   pageX: 635,
   pageY: 504,
   series: {
      [functions]: ... ,
      bars: { ... },
      color: "rgb(237,194,64)",
      dashes: { ... },
      data: [ ... ],
      datapoints: { ... },
      label: "Plot1",
      lines: { ... },
      points: { ... },
      shadowSize: 0,
      stack: true,
      xaxis: { ... },
      yaxis: { ... }
   },
   seriesIndex: 0
}