home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 25: Programming / pc_actual_25.iso / Delphi / TeeChartPro / TeeChart5Delphi5Eval.exe / %MAINDIR% / Examples / Features / Legend_TextStyle.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-09-10  |  1.1 KB  |  53 lines

  1. unit Legend_TextStyle;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   Base, StdCtrls, ExtCtrls, TeeProcs, TeEngine, Chart, Series;
  8.  
  9. type
  10.   TLegendStyle = class(TBaseForm)
  11.     Label1: TLabel;
  12.     ComboBox1: TComboBox;
  13.     Series1: TPieSeries;
  14.     procedure ComboBox1Change(Sender: TObject);
  15.     procedure FormCreate(Sender: TObject);
  16.     procedure FormShow(Sender: TObject);
  17.   private
  18.     { Private declarations }
  19.   public
  20.     { Public declarations }
  21.   end;
  22.  
  23. implementation
  24.  
  25. {$R *.DFM}
  26.  
  27. procedure TLegendStyle.ComboBox1Change(Sender: TObject);
  28. begin
  29.   inherited;
  30.   Case ComboBox1.ItemIndex of
  31.     0: Chart1.Legend.TextStyle:=ltsPercent;
  32.     1: Chart1.Legend.TextStyle:=ltsXAndValue;
  33.     2: Chart1.Legend.TextStyle:=ltsXAndPercent;
  34.   end;
  35. end;
  36.  
  37. procedure TLegendStyle.FormCreate(Sender: TObject);
  38. begin
  39.   inherited;
  40.   Series1.FillSampleValues(5);
  41.   Chart1.Legend.TextStyle:=ltsPercent;
  42. end;
  43.  
  44. procedure TLegendStyle.FormShow(Sender: TObject);
  45. begin
  46.   inherited;
  47.   ComboBox1.ItemIndex:=0;
  48. end;
  49.  
  50. initialization
  51.   RegisterClass(TLegendStyle);
  52. end.
  53.