Highcharts鼠标点信息

时间:2016-02-27 00:31:05

标签: javascript highcharts

我需要将信息表格鼠标悬停在Highcharts折线图中的点上,我尝试使用工具提示但是有一个错误:函数语句需要一个名称。我已将格式化程序放在plotOptions中作为onclick函数。我不知道我是否可以一起使用这两个选项。我还需要获取行名称。



   plotOptions:{
                series:{
                    allowPointSelect: true,
                    point: {
                        events:{
                            click: function(e) {/*$("#displayText").html(e.currentTarget.y)*/ 
                             
                              tooltip: {
	                         formatter: function () {
                             alert(this.x);
                                   }
                                   },
							  }
                        }                        
                    },
					
                }
            },




1 个答案:

答案 0 :(得分:1)

好吧,我完全错了。以下是检索折线图数据的答案。



    plotOptions:{
                series:{
                    allowPointSelect: true,
                    point: {
                        events:{
                            click: function() {
                            alert('Category: ' + this.category + ', value: ' + this.series.name ); //this.x+1 is the msgID
                            }
                        }                        
                    },
					
                }
            },




相关问题