Skip to content
This repository has been archived by the owner on Dec 2, 2020. It is now read-only.

Advanced Calculations

Samuel Spencer edited this page Aug 3, 2017 · 9 revisions

In addition to recording and displaying data, BEMSimpleLineGraph can also perform advanced calculations with your data. All calculation methods are available publicly and begin with "calculate". Each method returns an NSNumber as the result of the calculation based on the data in the graph.

Calculation Method Description
Average calculatePointValueAverage Calculates the average (mean) of all points on the line graph. See also: Average Lines
Sum calculatePointValueSum Calculates the sum of all points on the line graph.
Median calculatePointValueMedian Calculates the median of all points on the line graph.
Mode calculatePointValueMode Calculates the mode of all points on the line graph.
Standard deviation calculateLineGraphStandardDeviation Calculates the standard deviation of all points on the line graph.
Minimum calculateMinimumPointValue Calculates the minimum value of all points on the line graph.
Maximum calculateMaximumPointValue Calculates the maximum value of all points on the line graph.

Starting soon (and currently on the feature branch), you'll be able to access all calculation operations from the BEMGraphCalculator class. BEMGraphCalculator is independent from your graph, only needs to be instantiated once per app lifecycle, and can handle more complex operations than previously (including integration and correlation coefficients).