TiPlotChannel.AddYArray
TiPlotChannel
procedure AddYArray(XInterval: Double; YData : Variant);
Description
Adds multiple y values with a specified X-Axis spacing interval. For example,
if your variant array (Y values) contains 100 elements and your XInterval is
1, then the plot component will plot all of your Y values with an increasing X
value of 1. First data point is (1, YData[0]), second data point is
(2,YData[1]), third data point is (3,YData[2]), fourth data point is (4, YData[3]), etc.
This procedure is able to handle variant arrays that start at element 0 or any
value that you require. If you array starts at element YData[10], then that
value will be used to add the first data point.
Note: the interval depends on whether your X-Axis is in Date/Time format or not.
If LabelsFormatStyle of the X-Axis is iptfDateTime, then the interval must be specified in
Date/Time format. Otherwise, the interval is expressed in seconds or the units that
are used on your X-Axis.
Note: it is recommended that you loop through your array and use the AddXY method
to add data to the chart as that is much faster than using the AddYArray
procedure due to the use of Variants. This procedure has been added as a convenient
way of passing arrays to the channel to add data, but is slower than simply
looping through the array in your program.
Note: If your data is already in Variant array format (i.e. not a double array),
then there is no performance penalty by using the AddYArray procedure.
Example
Delphi
iComponent.Channel[0].AddYArray(5, YDataArray);
C++ Builder
iComponent->Channel[0]->AddYArray(5, YDataArray);
Contents | Index | Previous | Next