Page 1 of 1
Changing Circled labels in Polar Series
Posted: Thu May 26, 2005 9:50 am
by 9232649
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
Posted: Thu May 26, 2005 11:38 am
by Pep
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.
Calculating axis etc.
Posted: Thu May 26, 2005 12:27 pm
by 9232649
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
Maybe a stupid "sub" question
Posted: Thu May 26, 2005 1:34 pm
by 9232649
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
Posted: Thu May 26, 2005 2:18 pm
by narcis
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;
Axis size
Posted: Thu May 26, 2005 2:31 pm
by 9232649
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