Demo In this example we get the corresponding latest x-axis value of the max data in a y-axis series in Highcharts. Here's the code below with comments: $(function () { $('#container').highcharts({ xAxis: { categories: ['a', 'b', 'c', 'd', 'e', 'f'] }, series: [{ data: [5, 16, 10, 3, 12, 16] }, { data: [11, 18, 15, 16, 18, 11] }] }); $("#click").click(function () { var chart = $("#container").highcharts(), series, i = 0, arr = [], myIndex = [], //change the index of the series that you like to get s = chart.series[1], max = s.dataMax, len = s.data.length; //getting the index with max value in y-axis for (var j = 0; j < len; j++) { arr[j] = s.data[j].y; if (arr[j] =...
Comments
Post a Comment
Feel free to ask, suggest and comment regarding this post/blog. You can also contact me through e-mail, just always use the contact page. Thank you for visiting this blog.