Page 1 of 1

Caption/Title in the middle of a TDonutSeries

Posted: Fri Mar 30, 2018 7:41 pm
by 16582483
How do I put a caption/title in the middle of a TDonutSeries? I think I am missing the obvious.

Ed Dressel

Re: Caption/Title in the middle of a TDonutSeries

Posted: Tue Apr 03, 2018 6:48 am
by yeray
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;