unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Series, TeEngine, StdCtrls, ExtCtrls, TeeProcs, Chart;

type
  TForm1 = class(TForm)
    Chart1: TChart;
    Button1: TButton;
    Button2: TButton;
    Series1: TPieSeries;
    Series2: TLineSeries;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  Chart1.Title.Text.Clear;
  Chart1.Title.Text.Add('Wykres kołowy');
  Series2.Clear;
  Series1.Clear;
  with Series1 do
  begin
    Add(2,'nr1',clRed);
    Add(4,'nr2',clBlue);
    Add(6,'nr3',clGreen);
    Add(8,'nr4',clYellow);
    Add(10,'nr5',clNavy);
  end;
  Chart1.AxisVisible:=false;
end;

//wykres liniowy
procedure TForm1.Button2Click(Sender: TObject);
var i:integer;
begin
  Chart1.Title.Text.Clear;
  Chart1.Title.Text.Add('Wykres liniowy');
  Series1.clear;
  Series2.clear;
  for i:=-5 to 5 do
   begin
      Series2.AddXY(i,2*i*i,'',clRed);
   end;
   Chart1.AxisVisible:=true;

end;

end.
