Curve Fit Chart
The Curve Fit Chart calculates and plots a least squares fit to a series of observed data points (X,Y). The functional form of the curve fit can be selected from a variety of supported equations. The Curve Fit chart is implemented in the OCCurveFitItem
Internally, the Curve Fit chart maintains four groups of data. The first two groups store the raw (or input) X and Y data, which are plotted as blue dots. The third and fourth groups store points generated to describe the equation of the fit, which is plotted as a red line.
The input data is passed to OCCurveFitItem::SetData(int nSize, double* pInX, double pInY) as two arrays of doubles. Alternatively, OCCurveFitItem will create its own buffers if both pInX and pInY are NULL. In that case, OCCurveFitItem allocates and deallocates its own buffers, but the buffers must be initialized -- by calling SetValue() -- before the curve fit is generated or the chart is drawn.