0

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.

saulob
  • 615
  • 1
  • 10
  • 25

1 Answers1

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.

Community
  • 1
  • 1
Sebastian Bochan
  • 37,348
  • 3
  • 49
  • 75
  • Thank you :), I edited you answer and put a link with more info. – saulob Jul 02 '13 at 18:25
  • well, something is strange. If I use more than 1.000 points using this format on highstock the chart does not appear, without showing any error :( , any help? – saulob Jul 02 '13 at 18:30
  • just found that if I incput more than 655 'points' the additional values become 'undefined', I think I will create a new question just for that :) , thanks – saulob Jul 02 '13 at 18:37
  • 1
    You can modify turbothreshold parameter, then you will display more than 1000 points. http://api.highcharts.com/highcharts#plotOptions.series.turboThreshold – Sebastian Bochan Jul 03 '13 at 10:09
  • Sebastian, thanks, still not working :( , I added the turboThreshold more than my total points and still undefined... Only goes to 655 points :( , I tried the turboThreshold in the plotOptions series and spline. Should I create a new question for that? – saulob Jul 03 '13 at 12:12
  • Please attach link to jsfiddle – Sebastian Bochan Jul 03 '13 at 12:14
  • Created, the interesting thing it's that even with 500 on fiddle I was unable to make it work nice :( , http://jsfiddle.net/gGCFg/ , click on any point it will alert this.y , this.x and my additional values with the undefined – saulob Jul 03 '13 at 13:37
  • Thanks for the solution Sebastian, it's fixed :), the fix is here: http://stackoverflow.com/questions/17448415/highstock-click-values-undefined – saulob Jul 03 '13 at 15:02