Page 1 of 1

Donuts inside each other

Posted: Fri Jun 18, 2004 12:35 pm
by 8576535
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

Posted: Sun Jun 20, 2004 2:45 pm
by Marjan
Hi.

Which example/link are you refering too ?

Posted: Mon Jun 21, 2004 12:59 pm
by 8576535
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" :) ).

Posted: Mon Jun 21, 2004 1:58 pm
by Marjan
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;

Posted: Mon Jun 21, 2004 4:08 pm
by 8576535
Thanks - I'll go play with that.