I am trying to display values of an array as tooltip in highcharts line graph.I am currently using values entered from a textbox as tooltip but trying to display array values as tooltip..the js fiddle is given here http://jsfiddle.net/RbenU/75/
the tooltip code i am using is..
tooltip: {
formatter: function () {
var serieI = this.series.index;
var index = categories.indexOf(this.x);
var comment = $("input:eq(" + (index) + ")").val();
return '-->'+comment;
}
},
I want to display values of array n as tool-tip i.e. n[0] element for JAN, n[1] element for Feb so on and so forth..Points falling under the same month will have same tooltip..
Just use the index you are getting from the categories array to get that value from n:
declare an array:
instead of the line:
write the line:
and it should work...
jsfiddle example: http://jsfiddle.net/yoav_barnea/2meEg/