Highcharts - Get x Value From Y value -


how can x value providing y value between 2 points (an y value not in data).
have looked answer can loop on points present in data: http://jsfiddle.net/royzcfed/

$('#button').click(function(){ y1=$('#input').val(); var points = $('#container').highcharts().series[0].points; (var = 0; < points.length; i++) {     if (points[i].y == y1){     xvalue = points[i].x;     alert(xvalue);     break;        } } 

});

this larger question might thinking.

it beyond scope of highcharts, , relates more math in general. (ie highcharts doesn't plot out each pixel, tells browser draw line between 2 points)

some things consider:

1) given don't seem talking specific distribution function, have specify 2 points between trying find value. otherwise, y value potentially fall anywhere on chart , there no way correlate specific x value.

2) line between 2 points have straight line, or 1 follows specific formulaic curve

3) if not straight line, need have calculations built curve, , use them locate y , it's x. if straight line need calculate slope , intercept given 2 points working with, , work there (look calculating linear regression)


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -