2012-04-03 71 views
1

我正在使用Highcharts,并且我试图在tooltip:formatter部分显示this.z值(如果可能)。Highcharts Tooltip - 在系列数据阵列中访问“z”值

这是从PHP JSON数组我的背面到callbackFunction参数在JavaScript的例子:

[1315713600000,20,100] 

我能够访问该工具提示this.x(1315713600000)和this.y(20),但如果可能的话,则不能访问this.z(100)。

任何想法?

+0

This works:this.point.config [2] – Mike 2012-04-03 17:14:21

回答

3

就关闭了这个问题:

this.point.config[2] 
0

当哟JS创建数组,你应该命名属性

data = {x: xValue, y: yValue, z: zValue}, 

而且在提示你可以这样调用属性:

this.x 
this.y 
this.point.z