Highcharts为共享工具添加多个隐藏值

时间:2015-03-15 21:55:58

标签: highcharts

这是我的第一个问题! 我尝试在工具提示中添加多个隐藏值

我的数据示例:

var sample1= [{y:3.1,ext1:'14.5',ext2:'14.5',color:'#0ef43c'},{y:2.9,ext1:'14.2',ext2:'14.5',color:'#30ff21'},{y:2.9,ext1:'14.2',ext2:'14.5',color:'#42ff2c'},etc...
var sample2= [{y:3.1,ext1:'14.5',ext2:'14.5',color:'#0ef43c'},{y:2.9,ext1:'14.2',ext2:'14.5',color:'#30ff21'},{y:2.9,ext1:'14.2',ext2:'14.5',color:'#42ff2c'},etc...

和我的工具提示

 tooltip: {
            shared: true,
                 formatter: function() { 
                    var txt = Highcharts.dateFormat("<b>%Hh</b>", this.x);
                    txt += "<br /><b>Sample 1: </b>"+ this.points[0].point.y + " m - " + this.points[0].point.ext1 + "s" + this.points[0].point.ext2+ "s";
                    txt += "<br /><b>Sample 2: </b>"+ this.points[1].point.y + " m - " + this.points[1].point.ext1+ "s" + this.points[1].point.ext2+ "s";
                    txt += "<br />Sample 3: :" + this.points[2].point.y + " m";

                    return txt;

        }
        }, 

但隐藏数据存在问题,因此有一种方法可以使用代码 sample1.data.point.ext1  而不是this.points [0] .point.ext1?

由于

0 个答案:

没有答案