Donuts inside each other

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
MJ
Newbie
Newbie
Posts: 10
Joined: Thu May 08, 2003 4:00 am

Donuts inside each other

Post by MJ » Fri Jun 18, 2004 12:35 pm

Could someone please tell me how to get donut series to be independently sized? I have TeeChart 6 Pro, and there doesn't seem to be anything I can tweak to make them go inside each other as in the sample on the gallery first page. Clues welcome!

Matthew

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Sun Jun 20, 2004 2:45 pm

Hi.

Which example/link are you refering too ?
Marjan Slatinek,
http://www.steema.com

MJ
Newbie
Newbie
Posts: 10
Joined: Thu May 08, 2003 4:00 am

Post by MJ » Mon Jun 21, 2004 12:59 pm

http://www.steema.com/products/teechart/gallery.html has a pair of donuts in the second row, middle picture. I'd like to do that with my donuts too. (My Simpsons watching requires me that I now say "Mmmm, Donuts" :) ).

Marjan
Site Admin
Site Admin
Posts: 745
Joined: Fri Nov 07, 2003 5:00 am
Location: Slovenia
Contact:

Post by Marjan » Mon Jun 21, 2004 1:58 pm

Hi.

Ok, here' your donuts <g>. You can use donut series OnBeforeDrawValues event to reposition each donut series. For example, the following code will display two series in the same way as shown in the gallery:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Series1.FillSampleValues(5);
  Series2.FillSampleValues(5);
  Series1.DonutPercent := 70;
  Series2.DonutPercent := 70;
end;

procedure TForm1.Series1BeforeDrawValues(Sender: TObject);
begin
  with Chart1.ChartRect do
  begin
    Left := 0;
    Right := Chart1.Width ;
    Top := 0;
    Bottom := Chart1.Height ;
  end;
end;

procedure TForm1.Series2BeforeDrawValues(Sender: TObject);
begin
  with Chart1.ChartRect do
  begin
    Left := 100;
    Right := Chart1.Width - 100;
    Top := 100;
    Bottom := Chart1.Height - 100;
  end;
end;
Marjan Slatinek,
http://www.steema.com

MJ
Newbie
Newbie
Posts: 10
Joined: Thu May 08, 2003 4:00 am

Post by MJ » Mon Jun 21, 2004 4:08 pm

Thanks - I'll go play with that.

Post Reply