home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / TEECHART / Delphi1_And_Delphi2 / EXAMPLES / EXTENDED / UOTHPIE.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-10-24  |  1.4 KB  |  67 lines

  1. unit uothpie;
  2.  
  3. interface
  4.  
  5. uses
  6.   WinProcs,WinTypes, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   TeeComma, TeEngine, Series, StdCtrls, TeeProcs, Chart, ExtCtrls;
  8.  
  9. type
  10.   TOtherPieForm = class(TForm)
  11.     Panel1: TPanel;
  12.     Chart1: TChart;
  13.     Button1: TButton;
  14.     Memo1: TMemo;
  15.     CheckBox1: TCheckBox;
  16.     Series1: TPieSeries;
  17.     TeeCommander1: TTeeCommander;
  18.     procedure Button1Click(Sender: TObject);
  19.     procedure FormCreate(Sender: TObject);
  20.     procedure CheckBox1Click(Sender: TObject);
  21.   private
  22.     { Private declarations }
  23.   public
  24.     { Public declarations }
  25.   end;
  26.  
  27. var
  28.   OtherPieForm: TOtherPieForm;
  29.  
  30. implementation
  31.  
  32. {$R *.DFM}
  33.  
  34. procedure TOtherPieForm.Button1Click(Sender: TObject);
  35. begin
  36.   Close;
  37. end;
  38.  
  39. procedure TOtherPieForm.FormCreate(Sender: TObject);
  40. begin
  41.   Series1.FillSampleValues(10);
  42. end;
  43.  
  44. procedure TOtherPieForm.CheckBox1Click(Sender: TObject);
  45. begin
  46.   if CheckBox1.Checked then
  47.   begin
  48.     { lets group slices with a value lower than the minimum + 100 }
  49.     With Series1.OtherSlice do
  50.     begin
  51.       Style:=poBelowValue;
  52.       Value:=Series1.PieValues.MinValue+100;
  53.       Text:='Other < '+FloatToStr(Value);
  54.     end;
  55.  
  56.     { another way, using percents. Group slices below 10% :
  57.  
  58.     Series1.OtherSlice.Style:=poBelowPercent;
  59.     Series1.OtherSlice.Value:=10;
  60.     }
  61.   end
  62.   else
  63.     Series1.OtherSlice.Style:=poNone;
  64. end;
  65.  
  66. end.
  67.