Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Highcharts 从哈希中获取额外的系列数据,以在highstock的工具提示中显示_Highcharts_Highstock_Series - Fatal编程技术网

Highcharts 从哈希中获取额外的系列数据,以在highstock的工具提示中显示

Highcharts 从哈希中获取额外的系列数据,以在highstock的工具提示中显示,highcharts,highstock,series,Highcharts,Highstock,Series,我已经得到了在高位图表中工作的例子,但是我在高位股票中很难做到这一点。我试图让我的工具提示显示一些关于序列中提供的点的额外信息,但似乎我在序列数据哈希中输入的值没有正确保存。X和Y字段设置为ok,因为我可以看到正确的图形,但是我的其他“水果”和“名称”字段在工具提示中报告为null 以下是我的系列数据示例: { name: 'food1', fruit: 'apple', x: Date.UTC(2010, 0, 1), y: 216.4

我已经得到了在高位图表中工作的例子,但是我在高位股票中很难做到这一点。我试图让我的工具提示显示一些关于序列中提供的点的额外信息,但似乎我在序列数据哈希中输入的值没有正确保存。X和Y字段设置为ok,因为我可以看到正确的图形,但是我的其他“水果”和“名称”字段在工具提示中报告为null

以下是我的系列数据示例:

{
    name: 'food1',
    fruit: 'apple',
    x: Date.UTC(2010, 0, 1),
    y: 216.4                
},
{
    name: 'food2',
    fruit: 'banana',
    x: Date.UTC(2010, 0, 4),
    y: 116.4                
}
这是我的工具提示格式化程序中的循环:

$.each(this.points, function(i, point) {
    s += '<br/>Name is = '+ point.name;
    s += '<br/>y is = '+point.y;
    s += '<br/>Fruit is = ' +point.fruit;
});
$.each(this.points,function(i,point){
s+='
Name is='+point.Name; s+='
y是='+点y; s+='
水果是='+点水果; });
工具提示将显示: 名称为:未定义 y是:216.4 水果:未定义

我想让它显示: 姓名:food1 y是:216.4 水果是:苹果

以下是JSFIDLE链接:
您以错误的方式访问属性

应该是这样的

$.each(this.points,function(i,point){
s+='
名称为='+point.point.Name; s+='
y是='+点y; s+='
水果是='+point.point.Fruit; });

更新你的小提琴

我希望这对你有帮助