MtxVecTee.DrawValues Method

Overload List

#SignatureDescription
1procedure DrawValues(const Vectors: Array of TVec; Series: TChartSeries); overload;Copy several vectors to the same series in one pass.
2procedure 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.
3procedure DrawValues(A: TMtx; Series: TMtxGridSeries); overload;Plots a Z=Z(X,Y) using Series.
4procedure 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.
5procedure DrawValues(X,Y: TVec; Series: TChartSeries; PixelDownSample: boolean = false); overload;Plots a Y=Y(X) using Series.
6procedure 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.

#NameTypeDescription
1VectorsArray of TVec
2SeriesTChartSeries
Remarks:

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.

Examples
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.

#NameTypeDescription
1VectorsArray of TVec
2Seriesarray of TChartSeries
3PixelDownSampleboolean
Remarks:

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).

Examples
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.

#NameTypeDescription
1ATMtx
2SeriesTMtxGridSeries
Remarks:

Y,Z are matrix row/column indices and Z=Z(X,Y) are matrix values for specific cell.

Examples
#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.

#NameTypeDescription
1YTVec
2SeriesTChartSeries
3XOffsetdoublescalar
4XStepdoublescalar
5PixelDownSampleboolean
Remarks:

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).

Examples
#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;
See Also: MtxVecTee.DrawValues, MtxVecTee.DrawValues, MtxVecTee.DrawValues, MtxVecTee.DrawValues, MtxVecTee.DrawValues, MtxVecTee.DrawValues

Overload 5: procedure DrawValues(X,Y: TVec; Series: TChartSeries; PixelDownSample: boolean = false); overload;

Plots a Y=Y(X) using Series.

#NameTypeDescription
1XTVec
2YTVec
3SeriesTChartSeries
4PixelDownSampleboolean
Remarks:

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;

#NameTypeDescription
1Vectorsarray of TVec
2SeriesTChartSeries
3XOffsetdoublescalar
4XStepdoublescalar
Remarks:

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.