In a line mon chart: /
How can I get the average value of xAxis on selected elements?
In the above example, I can only access to the min and max values of the graph but not the inbetweeen values nor the minimum point selected value.
So, if I have 1,2,3,4,5 and I select points from 2 to 4 I want to have an array with [2,3,4] with an average value of (2+3+4)/3.
Is there any way to get, at least, the index array of min and max xAxis values?
Thanks in advance.
In a line mon chart: http://jsfiddle/yuKwp/
How can I get the average value of xAxis on selected elements?
In the above example, I can only access to the min and max values of the graph but not the inbetweeen values nor the minimum point selected value.
So, if I have 1,2,3,4,5 and I select points from 2 to 4 I want to have an array with [2,3,4] with an average value of (2+3+4)/3.
Is there any way to get, at least, the index array of min and max xAxis values?
Thanks in advance.
Share Improve this question asked Sep 19, 2012 at 14:14 MaCMaC 5387 silver badges14 bronze badges1 Answer
Reset to default 5If you need to count average value of points that will be in plot after xAxis extremes will be set, check out this fiddle: http://jsfiddle/yuKwp/3/ (i.e. you select points from 2 to 4, but after setting extremes, in plot will be points from 1 to 5)
But if you want to only count point that selected by yourself, check this fiddle: http://jsfiddle/yuKwp/4/
Hope this helps, but if not, don't be afraid to ask me.