Multiple Pies and Multiples Gauges ?

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Wysu
Newbie
Newbie
Posts: 21
Joined: Wed Apr 27, 2005 4:00 am

Multiple Pies and Multiples Gauges ?

Post by Wysu » Mon Mar 02, 2009 3:15 pm

Hi,

I'm using TC Pro FullSource 7. I've some questions about pies and gauges.

* About Multiples Pies :
- Is this possible to add a "title" on each pie ? Or a text area which point out the meaning of each pie.

- How to specify spacing between two pies, or if they verticaly or horizontally stack ?

* About Gauges :
- Is this possible to draw multiples gauges (like pies) on the same chart ?
I've tried but they always appear at the same point and are stacked.



* Extra question :
On multi series charts, is this possible to have a non visible serie which stock all parameters and dispatch them on all my visibles series.


Thanks.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Mar 02, 2009 4:09 pm

Hi Wysu,
* About Multiples Pies :
- Is this possible to add a "title" on each pie ? Or a text area which point out the meaning of each pie.
Yes, this can be done as shown here.
- How to specify spacing between two pies, or if they verticaly or horizontally stack ?
It just depends on how you set ChartRect for each series as shown in the example above.
* About Gauges :
- Is this possible to draw multiples gauges (like pies) on the same chart ?
I've tried but they always appear at the same point and are stacked.
Yes, same as in the example above can be done.
* Extra question :
On multi series charts, is this possible to have a non visible serie which stock all parameters and dispatch them on all my visibles series.
I'm not sure to understand what do you mean here. Could you please give us some more details?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Wysu
Newbie
Newbie
Posts: 21
Joined: Wed Apr 27, 2005 4:00 am

Post by Wysu » Mon Mar 02, 2009 5:34 pm

Hi , many thanks for your answers.

About my extra question, it concerns ChartEditor :

If I have 4 series in my chart, when i use the Chart editor, i have to parameter each serie (marks or others properties.
For exemple :
Style : pyramid
size %bardepth 80
marks arrow length 0
marks arrows distance -25
... And I have to do for each series in chart editor)

My idea was to simplify chart editor : have an hidden serie on chart, but present in chart Editor, who can lead all my others series parameters.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Tue Mar 03, 2009 9:48 am

Hi Wysu,

Yes, you can create such series in the chart editor, in the Chart -> Series tab use the "Clone" button for creating as many series as you wish with this series style and make this series not visible in the chart disabling its checkbox.

Hope this helps!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Wysu
Newbie
Newbie
Posts: 21
Joined: Wed Apr 27, 2005 4:00 am

Post by Wysu » Wed Mar 04, 2009 1:31 pm

Hi, thanks for previous answers.

I've a again a question about multiple pies.
I've tried your solution it works fine but something annoys me. It's visible in your example application :

Image

It seems that the two first (top) pies are bottom aligned whereas the 2 last (botom) pies are top aligned.

My questions :
Is it possible to define alignement in Chartrect ?
What is used to draw pies in chartrect ? center or top-left of the pie?

My aim was to center pies in their chartrect and not crush Chart.Canvas.TextOut that I add after ...

Thanks

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

Post by Yeray » Wed Mar 04, 2009 4:23 pm

Hi Wysu,

I think that this alignment is a visual effect, because is you set the chart to be 2D and you make the marks not visible, you can see how the 4 pies fill their whole defined ChartRect.

In any case, you always can change the ChartRect of each pie to look more "aligned" adding some "extra margin". For example:

Code: Select all

const extraMargin1 = 10;
extramargin2 = 30;
//...
procedure TPieMultiple.Series1BeforeDrawValues(Sender: TObject);
begin
  Chart1.ChartRect:=Rect(extraMargin1,extraMargin1,Chart1.Width div 2 - extraMargin1, Chart1.Height div 2 - extraMargin2);
end;

procedure TPieMultiple.Series2BeforeDrawValues(Sender: TObject);
begin
  Chart1.ChartRect:=Rect(Chart1.Width div 2 + extraMargin1, extraMargin1, Chart1.Width - extraMargin1, Chart1.Height div 2 - extraMargin2);
end;

procedure TPieMultiple.Series3BeforeDrawValues(Sender: TObject);
begin
  Chart1.ChartRect:=Rect(extraMargin1,Chart1.Height div 2 + extraMargin2,Chart1.Width div 2 - extraMargin1, Chart1.Height - extraMargin1);
end;

procedure TPieMultiple.Series4BeforeDrawValues(Sender: TObject);
begin
  Chart1.ChartRect:=Rect(Chart1.Width div 2 + extraMargin1, Chart1.Height div 2 + extraMargin2, Chart1.Width - extraMargin1, Chart1.Height - extraMargin1);
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