Description | Hierarchy | Fields | Methods | Properties |
type TAbstractDiagramModel = class(TPersistent)
This is the abstract model class which stores the data to be shown If you want full customization you can use it as base class, but in most cases a TDiagramDataListModel is easier
![]() |
constructor create; |
![]() |
destructor destroy; override; |
![]() |
function dataRows: longint; virtual; |
![]() |
function dataTitle(i:longint):string; virtual; |
![]() |
procedure setupCanvasForData(i:longint; c: TCanvas); virtual; |
![]() |
function dataPoints(i:longint):longint; virtual; abstract; |
![]() |
procedure data(i,j:longint; out x,y:float); virtual; abstract; |
![]() |
function setData(i,j:longint; const x,y:float):integer; virtual; |
![]() |
function addData(i:longint; const x,y:float):integer; virtual; |
![]() |
procedure removeData(i,j:longint); virtual; |
![]() |
function minX(i:longint):float; virtual; |
![]() |
function maxX(i:longint):float; virtual; |
![]() |
function minY(i:longint):float; virtual; |
![]() |
function maxY(i:longint):float; virtual; |
![]() |
function getFlags: TModelFlags; virtual; |
![]() |
function getRowFlags(i:longint): TModelRowFlags; virtual; |
![]() |
function getRowLineStyle(i:longint):TLineStyle; virtual; |
![]() |
function getRowPointStyle(i:longint):TPointStyle; virtual; |
![]() |
function find(i:longint; const x:float; const y:float=NaN; const xtolerance:float=DiagramEpsilon; const ytolerance:float=NaN):longint; virtual; |
![]() |
function findAndGet(i:longint; var x:float; var y:float=NaN; const xtolerance:float=DiagramEpsilon; const ytolerance:float=NaN):longint; virtual; |
![]() |
function findWithRow(out i:longint; const x:float; const y:float=NaN; const xtolerance:float=DiagramEpsilon; const ytolerance:float=NaN):longint; virtual; |
![]() |
function findWithRowAndGet(out i:longint; var x:float; var y:float=NaN; const xtolerance:float=DiagramEpsilon; const ytolerance:float=NaN):longint; virtual; |
![]() |
function dataX(i,j:longint):float; |
![]() |
function dataY(i,j:longint):float; |
![]() |
function minX:float; |
![]() |
function maxX:float; |
![]() |
function minY:float; |
![]() |
function maxY:float; |
![]() |
function lineApproximationAtX(const defaultLineStyle:TLineStyle; i:longint; const x: float): float; |
![]() |
function findLineApproximation(const defaultLineStyle:TLineStyle; const x,y:float; const ytolerance: float=DiagramEpsilon): longint; |
![]() |
procedure addModifiedHandler(event: TNotifyEvent); |
![]() |
procedure removeModifiedHandler(event: TNotifyEvent); |
![]() |
procedure addDestroyHandler(event: TNotifyEvent); |
![]() |
procedure removeDestroyHandler(event: TNotifyEvent); |
![]() |
property OnModified: TNotifyEvent read FOnModified write SetOnModified; |
![]() |
constructor create; |
![]() |
destructor destroy; override; |
![]() |
function dataRows: longint; virtual; |
This returns the number of data rows (override if you use more than 1) |
![]() |
function dataTitle(i:longint):string; virtual; |
This returns the title of every data row for the legend |
![]() |
procedure setupCanvasForData(i:longint; c: TCanvas); virtual; |
This setups the canvas (override it to set the color, set pen and brush to the same) |
![]() |
function dataPoints(i:longint):longint; virtual; abstract; |
Returns the count of data points in a given row |
![]() |
procedure data(i,j:longint; out x,y:float); virtual; abstract; |
This returns the actual |
![]() |
function setData(i,j:longint; const x,y:float):integer; virtual; |
Set the data point and returns the new index (default does nothing and returns j) (if you override it, keep in mind that data must return its values in a sorted order) |
![]() |
function addData(i:longint; const x,y:float):integer; virtual; |
Add a data point and returns the new index (default does nothing and returns -1) (if you override it, keep in mind that data must return its values in a sorted order) |
![]() |
procedure removeData(i,j:longint); virtual; |
removes a certain data point (default does nothing) |
![]() |
function minX(i:longint):float; virtual; |
returns the minimum x (default first data point, O(1)) |
![]() |
function maxX(i:longint):float; virtual; |
returns the maximum x (default last data point, O(1)) |
![]() |
function minY(i:longint):float; virtual; |
returns the minimum value (default scans all values, O(n)) |
![]() |
function maxY(i:longint):float; virtual; |
returns the maximum value (default scans all values, O(n)) |
![]() |
function getFlags: TModelFlags; virtual; |
returns model flags (e.g. editable) |
![]() |
function getRowFlags(i:longint): TModelRowFlags; virtual; |
returns flags for a given row |
![]() |
function getRowLineStyle(i:longint):TLineStyle; virtual; |
overrides drawer line style |
![]() |
function getRowPointStyle(i:longint):TPointStyle; virtual; |
overrides drawer line style |
![]() |
function find(i:longint; const x:float; const y:float=NaN; const xtolerance:float=DiagramEpsilon; const ytolerance:float=NaN):longint; virtual; |
Searchs the point in row i at position x,y with xtolerance, ytolerance If y is NaN, only the x position is used If ytolerance is NaN, the x tolerance is used for it If the point isn't found, it returns -1 The default implementation checks all points TODO: implement binary search |
![]() |
function findAndGet(i:longint; var x:float; var y:float=NaN; const xtolerance:float=DiagramEpsilon; const ytolerance:float=NaN):longint; virtual; |
like find but set the position to the correct values (default calls find) |
![]() |
function findWithRow(out i:longint; const x:float; const y:float=NaN; const xtolerance:float=DiagramEpsilon; const ytolerance:float=NaN):longint; virtual; |
like find but searchs in all rows and returns the correct one (default calls find) |
![]() |
function findWithRowAndGet(out i:longint; var x:float; var y:float=NaN; const xtolerance:float=DiagramEpsilon; const ytolerance:float=NaN):longint; virtual; |
like findRow but set the position to the correct values (default calls findAndGet) |
![]() |
function dataX(i,j:longint):float; |
returns x of point i,j, calls data |
![]() |
function dataY(i,j:longint):float; |
returns y of point i,j, calls data |
![]() |
function minX:float; |
![]() |
function maxX:float; |
![]() |
function minY:float; |
![]() |
function maxY:float; |
![]() |
function lineApproximationAtX(const defaultLineStyle:TLineStyle; i:longint; const x: float): float; |
this returns the position of the interpolation line (linear/cubic) in data coordinates |
![]() |
function findLineApproximation(const defaultLineStyle:TLineStyle; const x,y:float; const ytolerance: float=DiagramEpsilon): longint; |
finds a line like find. (since the line is 1-dimensional the x coordinate is not sufficient and has to be exact) |
![]() |
procedure addModifiedHandler(event: TNotifyEvent); |
![]() |
procedure removeModifiedHandler(event: TNotifyEvent); |
![]() |
procedure addDestroyHandler(event: TNotifyEvent); |
![]() |
procedure removeDestroyHandler(event: TNotifyEvent); |
![]() |
property OnModified: TNotifyEvent read FOnModified write SetOnModified; |