home *** CD-ROM | disk | FTP | other *** search
- unit Udelpoin;
-
- interface
-
- { This example project shows how to delete points from
- a Series.
- After deleting points, you can optionally "compact"
- the remaining points to "fill the gap" leaved by the
- deleted points.
- }
- uses
- Winprocs, Wintypes, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, Buttons, TeEngine, Series, ExtCtrls, TeeProcs, Chart;
-
- type
- TDeletePointsForm = class(TForm)
- Chart1: TChart;
- BitBtn1: TBitBtn;
- Button1: TButton;
- Series1: TBarSeries;
- Button2: TButton;
- procedure BitBtn1Click(Sender: TObject);
- procedure FormCreate(Sender: TObject);
- procedure Button1Click(Sender: TObject);
- procedure Button2Click(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- DeletePointsForm: TDeletePointsForm;
-
- implementation
-
- {$R *.DFM}
-
- procedure TDeletePointsForm.BitBtn1Click(Sender: TObject);
- begin
- if Series1.Count>3 then Series1.Delete(3); { <-- delete the fourth point }
- end;
-
- procedure TDeletePointsForm.FormCreate(Sender: TObject);
- begin
- Series1.FillSampleValues(16); { <-- random points }
- end;
-
- procedure TDeletePointsForm.Button1Click(Sender: TObject);
- begin
- Close;
- end;
-
- procedure TDeletePointsForm.Button2Click(Sender: TObject);
- begin
- Series1.XValues.FillSequence; { <-- compact space }
- Series1.Repaint;
-
- { Note: For Horizontal Bar Series, you should call
- Series1.YValues.FillSequence instead of XValues. }
- end;
-
- end.
-