Javascript 散点图中的三点数据
我正在使用highchart显示散点图。 提供给高位图表的数据为格式Javascript 散点图中的三点数据,javascript,angularjs,highcharts,Javascript,Angularjs,Highcharts,我正在使用highchart显示散点图。 提供给高位图表的数据为格式 [ obj1 : [ { "x":"0.1", "y":"12", "id":"154" },.... ],.... ] 图形正确地绘制在x轴和y轴上 我的问题是,当我单击任何点时,我希望能够使用第三个值id,但它在该点中不可见。我试图打印
[
obj1 : [
{
"x":"0.1",
"y":"12",
"id":"154"
},....
],....
]
图形正确地绘制在x轴和y轴上
我的问题是,当我单击任何点时,我希望能够使用第三个值id,但它在该点中不可见。我试图打印出点对象,但它没有任何类型的名为id的对象
任何帮助都将受到感谢
series: {
cursor: 'pointer',
point: {
events: {
click: function () {
// here I want the y value of the point in the
// first series even in this function
// is invoked for the point in the second series
alert('value: ' + this);
}
}
}
}
请使用此选项,我认为如果您打印此对象,它将为您提供在系列中传递的所有点。使用单击事件
plotOptions: {
series: {
dataLabels: {
align: 'left',
enabled: false,
format: '{point.id}',
},
point: {
events: {
click: function() {
alert('Id: ' + this.id);
}
}
}
}
},
假设您的系列数据如下
data: [
{x:161.2,y:51.6,id:154},{x:100.2,y:60.6,id:155},{x:161.2,y:151.6,id:157}]
}]
你能把这个添加到提琴中吗?即使OP没有提供任何现场的demofiddle、plunker等。你能添加示例来说明你解释的内容吗。