The onDrawLabel event is only invoked for horizontal and vertical axes, but not for depth axes.
Dave
OnDrawLabel is not called when drawing the depth axis
-
- Newbie
- Posts: 71
- Joined: Fri Jul 02, 2004 4:00 am
- Location: Culver City
- Contact:
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Dave,
Thanks for reporting. I could reproduce the issue here and added it (TV52011624) to our defect list to be fixed for future releases. In the meantime you can try using the OnGetAxisLabel event, for example:
If you are a source code customer, another option would be trying one customer, Alexey Kuznetsov, suggested in our public newsgroups:
Thanks for reporting. I could reproduce the issue here and added it (TV52011624) to our defect list to be fixed for future releases. In the meantime you can try using the OnGetAxisLabel event, for example:
Code: Select all
procedure TForm1.Chart1GetAxisLabel(Sender: TChartAxis;
Series: TChartSeries; ValueIndex: Integer; var LabelText: String);
begin
if (sender = Chart1.Axes.Depth) then
LabelText:='Hi!';
end;
Code: Select all
unit TeEngine;
.... somewhere in this unit add or modify lines marked with {kuaw} ...
Procedure DrawThisLabel(LabelPos:Integer; Const tmpSt:String;
Format:TTeeCustomShape=nil);
var tmpZ : Integer;
tmpPos : Integer;
{kuaw}tmpY: integer;
{kuaw}tmpDraw: boolean;
{kuaw}tmpS: string;
begin
if TickOnLabelsOnly then
AddTick(LabelPos);
With ParentChart,Canvas do
begin
if Assigned(Format) then AssignFont(Format.Font)
else AssignFont(Items.Format.Font);
// trick
Brush.Style:=bsSolid;
Brush.Style:=bsClear;
{$IFDEF CLX}
BackMode:=cbmTransparent;
{$ENDIF}
if IsDepthAxis then
begin
TextAlign:=DepthAxisAlign;
if (View3DOptions.Rotation=360) or View3DOptions.Orthogonal then
tmpZ:=LabelPos+(FontHeight div 2)
else
tmpZ:=LabelPos;
if OtherSide then tmpPos:=PosLabels
else tmpPos:=PosLabels-2-(TextWidth('W') div 2);
{kuaw} tmpY := DepthAxisPos;
{kuaw} tmpS := tmpSt;
{kuaw} tmpDraw := true;
{kuaw} if Assigned(FOnDrawLabel) then // 7.0
{kuaw} FOnDrawLabel(Self,tmpPos, tmpY, tmpZ, tmpS, tmpDraw);
{kuaw} if (tmpDraw) then TextOut3D(tmpPos, tmpY, tmpZ, tmpS);
{kuaw: was simply TextOut3D(tmpPos,DepthAxisPos,tmpZ,tmpSt); without
calling OnDrawLabel event}
....
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Newbie
- Posts: 71
- Joined: Fri Jul 02, 2004 4:00 am
- Location: Culver City
- Contact: