Greetings! There's nothing within the GWT Highcharts wrapper or Highcharts.js (that I know of) to run statistical methods on a series, but given that GWT is all Java you can certainly just write a simple method to calculate the average for you (similar to what is shown in that jsfiddle example). E.g.
public static double getSeriesAverage(Series series) {
Point[] points = series.getPoints();
double sum = 0;
for (Point point : points) {
sum += point.getY().doubleValue();
}
return sum / points.length;
}
Hope that helps.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yeah, you could create a new series for the average line and add it to the chart, or you may find "plot lines" useful for this kind of scenario. Example here:
You'll need to put the Series that you're interested in running the average on in a variable first (e.g. Series series = chart.createSeries()...) and then call the "getSeriesAverage()" method after you have added the points to the series.
Last edit: Shawn Quinn 2014-05-20
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Last edit: Velo 2014-05-21
Greetings! There's nothing within the GWT Highcharts wrapper or Highcharts.js (that I know of) to run statistical methods on a series, but given that GWT is all Java you can certainly just write a simple method to calculate the average for you (similar to what is shown in that jsfiddle example). E.g.
Hope that helps.
Last edit: Velo 2014-05-21
Yeah, you could create a new series for the average line and add it to the chart, or you may find "plot lines" useful for this kind of scenario. Example here:
http://www.moxiegroup.com/moxieapps/gwt-highcharts/apidocs/org/moxieapps/gwt/highcharts/client/PlotLine.html
Last edit: Velo 2014-05-21
You'll need to put the Series that you're interested in running the average on in a variable first (e.g. Series series = chart.createSeries()...) and then call the "getSeriesAverage()" method after you have added the points to the series.
Last edit: Shawn Quinn 2014-05-20
Last edit: Velo 2014-05-20
i did this:
and now i do't know yet, how to draw this line for average with value,
Last edit: Velo 2014-05-20