TMtxGridSeries Class

TChartSeries→TMtxGridSeries

type TMtxGridSeries = class(TChartSeries);

2D grid series used for drawing matrix values.

2D grid series used for drawing matrix values. The series is derived from TColorGridSeries (copyright David Berneda). TMtxGridSeries supports two different ways to represent matrix values: Define color for minimum value, color for maximum value and number of levels in between. The algorithm will then automatically create palette entries with correcponding color for each level. In this case you have to set <See cref="BottomColor"/>, <See cref="TopColor"/> and <See cref="PaletteSteps"/> properties and set PaletteStyle to palAuto. The number of steps in the palette will not affect the fill-in speed of the bitmap and you can be very generous, if needed by specifying large PaletteSteps count. Define each level and it's color manually. Using this approach you can easily plot values using nonlinear color scale. In this case use <See cref="ColorPalette.Add"/> function to add new palette entries/levels. This method has the slowest fill-in speed of the bitmap and its speed linearly depends upon the number of palette entries. The series supports many different color scales and combinations. <Example>Generates a continuous color scale with simple color transition between blue and green and rainbow color transition between green and red. <code> uses MtxExpr, Math387, MtxVec, MtxVecEdit; procedure TForm1.FormCreate(Sender: TObject); var A: Matrix; GridSeries: TMtxGridSeries; begin GridSeries := TMtxGridSeries.Create(Chart1); GridSeries.ColorPalette.PaletteStyle := palAuto; GridSeries.ColorPalette.ColorBalance := 0; GridSeries.ColorPalette.UseMidColor := True; GridSeries.ColorPalette.Rainbow.MidToTop := True; A.Size(20,20); Vector(A).Ramp; DrawValues(A,GridSeries); end; </code> <code lang="C++"> #include "MtxExpr.hpp" #include "MtxVecEdit.hpp" #include "MtxVecTee.hpp" __fastcall TForm1::TForm1(TComponent* Owner): TForm(Owner) { sMatrix A; TMtxGridSeries *GridSeries; GridSeries = new TMtxGridSeries(Chart1); GridSeries->ColorPalette->PaletteStyle = palAuto; GridSeries->ColorPalette->Clear(); GridSeries->ColorPalette->ColorBalance = 0; GridSeries->ColorPalette->UseMidColor = true; GridSeries->ColorPalette->Rainbow->MidToTop = true; A.Size(20,20); A()->Ramp(); //view A as a Vector DrawValues(A,GridSeries); } </code> </Example>

Examples

delphi
uses MtxExpr, Math387, MtxVec, MtxVecEdit;

procedure TForm1.FormCreate(Sender: TObject);
var A: Matrix;
GridSeries: TMtxGridSeries;
begin
    GridSeries := TMtxGridSeries.Create(Chart1);

    GridSeries.ColorPalette.PaletteStyle := palAuto;
    GridSeries.ColorPalette.ColorBalance := 0;
    GridSeries.ColorPalette.UseMidColor := True;
    GridSeries.ColorPalette.Rainbow.MidToTop := True;

    A.Size(20,20);
    Vector(A).Ramp;
    DrawValues(A,GridSeries);
end;

Properties

NameTypeDescription
MatrixTMtxMatrix to be displayed.

Methods

NameDescription
Clicked
CountLegendItems
Create
Destroy
LegendItemColor
LegendString
MaxValueReturns maximum Z (depth) value drawn, after the chart has been repainted.
MaxXValue
MaxYValue
MinValueReturns minimum Z (depth) value drawn, after the chart has been repainted.
MinXValue
MinYValue
SeriesToLegendConfigure the series as color scale legend for the Src series.
UpdateCall update after filling Matrix with data to trigger chart repaint.
UpdateColorCalled internally, when a color parameter changes.