Creates a new FMX.RS.BarCharts.TRSCandleStickChartValue instance and adds it to the Items array. The new instance is initialized with the X, Close, High, Low, Caption, and Color parameters (Open is set to previous value's Close and Average=Low+(High-Low)/2). Call Add to create a candlestickr value in the collection. The new value is placed at the end of the Items array, or, if the collection is Sorted, placed at the sorted point in the collection (based on a default value (0)).
Add returns the new candlestick value.
Namespace: FMX.RS.BarCharts
Delphi
|
public
function Add( X, Close, High, Low: TRSChartValueType; Caption: String = ''; Color: TCanvasColor = clxDefaultColor ): TRSCandleStickChartValue; overload;
|
Parameters
X
Type: TRSChartValueType
Close
Type: TRSChartValueType
High
Type: TRSChartValueType
Low
Type: TRSChartValueType
Caption
Type: String
Color
Type: TCanvasColor
Return Value
Type: TRSCandleStickChartValue
The following example creates values in the collection:
Delphi
|
var
Value: TRSCandleStickChartValue; // note, this type should be the same that the chart uses (e.g., TRS2DChartValue, TRSArrowChartValue, etc)
begin
Value := MyChart.Values.Add;
Value.Caption := 'One';
Value.Color := clRed;
Value.XAsDateTime := EncodeDate(1999, 1, 30);
Value.High := 100;
Value.Low := 30;
Value.Average := 50;
Value.Open := 80;
Value.Close := 85;
// this code adds the same point but much more quickly
Value := MyChart.Values.Add( EncodeDate(1999, 1, 30), 80, 85, 100, 30, 50, 'One', clRed );
end;
|
|
Reference
• | TRSCandleStickChartValues.Add(TRSChartValueType,string,TCanvasColor) |
• | TRSCandleStickChartValues.Add(TRSChartValueType,TRSChartValueType,TRSChartValueType,TRSChartValueType,TRSChartValueType,string,TCanvasColor) |
• | TRSCandleStickChartValues.Add(TRSChartValueType,TRSChartValueType,TRSChartValueType,TRSChartValueType,TRSChartValueType,TRSChartValueType,string,TCanvasColor) |
|