Hide Comments
Hide Comments

Comments (0)

Create an OnCustomFunction event handler to write your own functions. Note that the OnCustomFunction event handler is called for every Period in the SourceChart.

You only need to write the function itself and for adding value(s) to the TargetChart. The TRSCustomChartFunction class does all the housekeeping necessary for preparing the TargetChart (e.g., calling BeginUpdate/EndUpdate, clearing values)

noteNote

The OnCustomFunction event is only called if the FunctionType is cftCustom.

Namespace: RSChartFunction

expandingSyntax

Delphi

public
  property OnCustomFunction: TRSChartFunctionEvent read FOnCustomFunction write FOnCustomFunction;
 

Value

Type: TRSChartFunctionEvent

expandingRemarks

If you function needs information outside the period (for example, to compare your value to the maximum for the whole SourceChart), you can use the OnExecutingFunction event and OnExecutedFunction event, which are called once each (before and after respectively).

expandingExamples

Delphi

procedure frmChartFunction.RSChartFunction1CustomFunction(const SourceChart, TargetChart: TRSCustomChart; IndexLow, IndexHigh: Integer;
 TimeStamp: TDateTime);
 var
   I: Integer;
   aResult: TRSChartValueType;
 begin
   // function to calculate the minimum value in the period
   aResult := SourceChart.Values[IndexLow].Value;
   for I := IndexLow+1 to IndexHigh do
     if SourceChart.Values[i].Value < aResult then
       aResult := SourceChart.Values[i].Value;
   if TargetChart.Values.DimensionCount > 1 then
     TargetChart.Values.Add([TimeStamp, aResult])
   else
     TargetChart.Values.Add(aResult);
 end;

expandingSee Also

Comments (0)

RiverSoftAVG Charting Component Suite (RCCS) © 2005-2015, Thomas G. Grubb