Overload List
| # | Signature | Description |
|---|---|---|
| 1 | procedure DrawValues(const Vectors: Array of TVec; Series: TChartSeries); overload; | Copy several vectors to the same series in one pass. |
| 2 | procedure DrawValues(const Vectors: Array of TVec; const Series: array of TChartSeries; PixelDownSample: boolean = false); overload; | Copy each of the vector in Vectors array to separate series in Series array. |
| 3 | procedure DrawValues(A: TMtx; Series: TMtxGridSeries); overload; | Plots a Z=Z(X,Y) using Series. |
| 4 | procedure DrawValues(Y: TVec; Series: TChartSeries; XOffset: double = 0; XStep: double = 1.0; PixelDownSample: boolean = false); overload; | Draws vector or matrix values by using any valid already created chart series. |
| 5 | procedure DrawValues(X,Y: TVec; Series: TChartSeries; PixelDownSample: boolean = false); overload; | Plots a Y=Y(X) using Series. |
| 6 | procedure DrawValues(const Vectors: array of TVec; Series: TChartSeries; XOffset: double; XStep: double = 1.0); overload; |
Overload 1: procedure DrawValues(const Vectors: Array of TVec; Series: TChartSeries); overload;
Copy several vectors to the same series in one pass.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vectors | Array of TVec | |
| 2 | Series | TChartSeries |
Copy each of the vector in Vectors array to Series TChartValueList(s): XValues, YValues, ZValues,.... Use this routine, if you want to copy several vectors to the same series in one pass.
Note
Use this routine to construct error chart with only one line of code.
sVector x,y,error;
// ...
DrawValues(OPENARRAY(TVec*,(x,y,error)),ErrorSeries1);
// ...
You want to plot error chart by ussing TErrorSeries (see Teechart help to learn more about this). If the necessary data is stored in three vectors:
Vectors[0] = XVec, Vectors[1] = YVec, Vectors[2] = ErrorVec
then you can use
var x,y,error: Vector;
begin
// ...
DrawValues([x,y,error],ErrorSeries1);
// ...
end;
Overload 2: procedure DrawValues(const Vectors: Array of TVec; const Series: array of TChartSeries; PixelDownSample: boolean = false); overload;
Copy each of the vector in Vectors array to separate series in Series array.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vectors | Array of TVec | |
| 2 | Series | array of TChartSeries | |
| 3 | PixelDownSample | boolean |
If parameter PixelDownSample is True, the DrawValues will automatically use PixelDownSample method to reduce the number of points displayed for all series (much faster display).
sVector y1,y2,y3;
TMtxFastLineSeries fast1,fast2,fast3;
begin
// ...
DrawValues(OPENARRAY(TVec*,(y1,y2,y3)),OPENARRAY(TMtxFastLineSeries*,(fast1,fast2,fast3)), true); // downsample data
// ...
end;
Plot data coming from several instruments using one line of code:
var y1,y2,y3: Vector;
fast1,fast2,fast3: TMtxFastLineSeries;
begin
// ...
DrawValues([y1,y2,y3],[fast1,fast2,fast3], True); // downsample data
// ...
end;
Overload 3: procedure DrawValues(A: TMtx; Series: TMtxGridSeries); overload;
Plots a Z=Z(X,Y) using Series.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | A | TMtx | |
| 2 | Series | TMtxGridSeries |
Y,Z are matrix row/column indices and Z=Z(X,Y) are matrix values for specific cell.
#include "MtxExpr.hpp"
#include "MtxVecTee.hpp"
__fastcall TForm1::TForm1(TComponent* Owner): TForm(Owner)
{
sMatrix A;
TMtxGridSeries *GridSeries;
GridSeries = new TMtxGridSeries(Chart1);
GridSeries->ColorPalette->PaletteStyle = palRange;
GridSeries->ColorPalette->Clear();
GridSeries->ColorPalette->ColorBalance = 0;
GridSeries->ColorPalette->UseMidColor = true;
GridSeries->ColorPalette->Rainbow->MidToTop = true;
A.Size(20,20);
A()->Ramp(); //obtain view of A as a Vector and call Vector method.
DrawValues(A,GridSeries);
}
Generates a continuous color scale with simple color transition between blue and green and rainbow color transition between green and red.
uses MtxExpr, Math387, MtxVec, MtxVecEdit;
procedure TForm1.FormCreate(Sender: TObject);
var A: Matrix;
GridSeries: TMtxGridSeries;
begin
GridSeries := TMtxGridSeries.Create(Chart1);
GridSeries.ColorPalette.PaletteStyle := palRange;
GridSeries.ColorPalette.ColorBalance := 0;
GridSeries.ColorPalette.UseMidColor := True;
GridSeries.ColorPalette.Rainbow.MidToTop := True;
A.Size(20,20);
Vector(A).Ramp;
DrawValues(A,GridSeries);
end;
Overload 4: procedure DrawValues(Y: TVec; Series: TChartSeries; XOffset: double = 0; XStep: double = 1.0; PixelDownSample: boolean = false); overload;
Draws vector or matrix values by using any valid already created chart series.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Y | TVec | |
| 2 | Series | TChartSeries | |
| 3 | XOffset | double | scalar |
| 4 | XStep | double | scalar |
| 5 | PixelDownSample | boolean |
Plots a Y=Y(X) using Series. X values are calculated using the following formula
X[i] = XOffSet + XStep*i
If parameter PixelDownSample is True, then DrawValues will automatically use PixelDownSample method to reduce the number of points displayed (much faster display).
#include "MtxExpr.hpp"
#include "MtxVecTee.hpp"
__fastcall TForm1::TForm1(TComponent* Owner): TForm(Owner)
{
sVector Y;
// TMtxFastLineSeries Series1;
Y = Sin(Ramp(100,0,2*PI*5/100));
DrawValues(Y, Series1, 10.5, 0.05);
}
Plot Y=Y(X) with starting point for x values equal to 10.5 and x step equal to 0.05.
You have to put a chart on the form and add it one series which should be named "Series1".
uses MtxExpr, Math387, MtxVec, MtxVecEdit;
procedure TForm1.FormCreate(Sender: TObject);
var Y: Vector;
// Series1: TMtxFastLineSeries;
begin
Y := Sin(Ramp(100,0,2*PI*5/100));
DrawValues(Y, Series1, 10.5, 0.05);
end;
Overload 5: procedure DrawValues(X,Y: TVec; Series: TChartSeries; PixelDownSample: boolean = false); overload;
Plots a Y=Y(X) using Series.
If parameter PixelDownSample is True, then DrawValues will automatically use PixelDownSample method to reduce the number of points displayed (much faster display).
Overload 6: procedure DrawValues(const Vectors: array of TVec; Series: TChartSeries; XOffset: double; XStep: double = 1.0); overload;
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Vectors | array of TVec | |
| 2 | Series | TChartSeries | |
| 3 | XOffset | double | scalar |
| 4 | XStep | double | scalar |
When a series requires 3 or more input vectors, X, Y and Z, the Vectors open array holds the Y,Z... and the XOffset and XStep parameters are used to construct the X vector.