highstocks, how can I bring values that I will only use on the 'click' option?

筅森魡賤 提交于 2019-12-12 05:41:35

问题


Let me try to explain.

I'm bringing the data:

[1, 3, 7, 8, 9, 2]

But for each one of these there are other values, like time and place. I would like to make a click function like:

click: function() {
 testFunction(time.value,place.value);
}

Like this, that I click and it will call a javascript function that I could pass these other values? How can I store these values and send it? Where do I store other values, temp values to use in a function?

Found this demo, would be something like that: http://www.highcharts.com/demo/line-ajax

But I'm not showing anything on the screen, I would like to show only when clicked. this.y and this.x is there on the charts already :(

Thanks.


回答1:


You can use objects for points.

    data:[{
y:10,
additional:'myparametervalue'
},{
y:10,
additional:'myparametervalue'
}]

Edit:

Found an answer, with an example and more info about how do it from a similar question.



来源:https://stackoverflow.com/questions/17425857/highstocks-how-can-i-bring-values-that-i-will-only-use-on-the-click-option

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!