Caption/Title in the middle of a TDonutSeries

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Ed Dressel
Newbie
Newbie
Posts: 28
Joined: Tue Dec 05, 2017 12:00 am

Caption/Title in the middle of a TDonutSeries

Post by Ed Dressel » Fri Mar 30, 2018 7:41 pm

How do I put a caption/title in the middle of a TDonutSeries? I think I am missing the obvious.

Ed Dressel

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Caption/Title in the middle of a TDonutSeries

Post by Yeray » Tue Apr 03, 2018 6:48 am

Hello,

You could use a TAnnotationTool as follows:

Code: Select all

uses TeeDonut, TeeTools;

var donut1: TDonutSeries;
    annot1: TAnnotationTool;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.Legend.Hide;
  Chart1.View3D:=False;

  donut1:=Chart1.AddSeries(TDonutSeries) as TDonutSeries;
  donut1.FillSampleValues;

  annot1:=Chart1.Tools.Add(TAnnotationTool) as TAnnotationTool;
  annot1.Text:='Annotation';

  Chart1.Draw;
  annot1.Left:=donut1.CircleXCenter -(annot1.Width div 2);
  annot1.Top:=donut1.CircleYCenter -(annot1.Height div 2);
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply