Changing Circled labels in Polar Series

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Johan Ingemansson
Newbie
Newbie
Posts: 59
Joined: Fri May 28, 2004 4:00 am
Location: Sweden

Changing Circled labels in Polar Series

Post by Johan Ingemansson » Thu May 26, 2005 9:50 am

Hi,

I want to do a so called spider diagram using the TPolarSeries, in a spider diagram the labels of the replies should be displayed where the circled labels are now. Is there anyway of changing theese labels?

I´ve read another post where Steema recommended overriding the default settings in the creation of theese labels, the problem is that theese labels aren´t the same everytime.

Best Regards,

Johan Ingemansson

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu May 26, 2005 11:38 am

Hi Johan,

the only way around this is to manually draw axis labels on chart Canvas. You could use the TCanvas.RotateLabel method to draw axis label at specific position (in the OnAfterDraw event). The trick is (obviously) to calculate correct position and (more importantly) check for overlaps. The first part is already done in TeePolar.pas (which you can update if you're source code customer) , the second part still has to be improved.

Johan Ingemansson
Newbie
Newbie
Posts: 59
Joined: Fri May 28, 2004 4:00 am
Location: Sweden

Calculating axis etc.

Post by Johan Ingemansson » Thu May 26, 2005 12:27 pm

Hi Pep,

Ok, I´ll do that, already have an "anti" overlapping algorithm, which I should be able to apply here! Thx!

Best Regards,

Johan Ingemansson
:D

Johan Ingemansson
Newbie
Newbie
Posts: 59
Joined: Fri May 28, 2004 4:00 am
Location: Sweden

Maybe a stupid "sub" question

Post by Johan Ingemansson » Thu May 26, 2005 1:34 pm

Hi again,

One moore thing, I have set the PositionUnits:=muPixels on all axes. If I take for example:

Chart1.Axes.Bottom.IEndPos-Chart1.Axes.Bottom.IStartPos

and now I do the same for the left axis, then theese values are not the same, in my case there is a 3 pixel difference, shouldn´t theese axes be exactly the same if a symmetric circle should be created? I have also set ASerie.Circled:=True.

Best Regards,

Johan Ingemansson

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

Post by Narcís » Thu May 26, 2005 2:18 pm

Hi Johan,

It works fine for me here using latest TeeChart version (v7.04). Which version are you using?

Also notice that Chart1.Axes.Bottom.IAxisSize is the same as doing Chart1.Axes.Bottom.IEndPos-Chart1.Axes.Bottom.IStartPos:

Code: Select all

procedure TForm1.FormCreate(Sender: TObject);
begin
  Series1.FillSampleValues();
  Series1.Circled:=true;
  Memo1.Clear;
end;

procedure TForm1.Chart1AfterDraw(Sender: TObject);
var i: Integer;
begin
  for i:=0 to Chart1.Axes.Count - 1 do
    With Chart1.Axes[i] do
    begin
      PositionUnits:=muPixels;
      Memo1.Lines.Add(IntToStr(i) + ': ' + IntToStr(IAxisSize));
    end;
end;
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

Johan Ingemansson
Newbie
Newbie
Posts: 59
Joined: Fri May 28, 2004 4:00 am
Location: Sweden

Axis size

Post by Johan Ingemansson » Thu May 26, 2005 2:31 pm

Hi,

Thanks for the advice of IAxisSize! I´m currently using TeeChartPro 7.01 with source code, I still get this problem that is, the right/left axis is three pixels longer then bottom/top axis, but then it must be a version difference. Thank you for your quick response!

Best Regards,

Johan Ingemansson

Post Reply