如何获得Highcharts中某个点的索引? [英] How to get index of a point in Highcharts?

查看:160
本文介绍了如何获得Highcharts中某个点的索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Highcharts的时间数据与不规则间隔图表。正如你知道当鼠标移过点时格式化函数运行并显示一些信息。我想知道鼠标移过它的点的索引。因此,如果鼠标移动到第一个点上,tooltip显示1,第二个点显示2,依此类推。 thnx。

I'm using "Time data with irregular intervals" chart of Highcharts. As you know when mouse moves over points of line the formatter function runs and shows some information. I want to know index of the point that mouse moves over it. So if mouse moves over first point of the line, tooltip shows "1" and the second point shows "2" and so on. thnx.

推荐答案

这适用于我使用v2.2:

This worked for me using v2.2:

this.series.data.indexOf( this.point )

这篇关于如何获得Highcharts中某个点的索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆