Hello,
axrDegen wrote: ↑Wed Jul 03, 2019 8:03 am
Distance and sizes are not Ok
This is probably due to some difference between your application and my test app.
Please arrange a simple example project we can run as-is to reproduce the problem here.
axrDegen wrote: ↑Wed Jul 03, 2019 8:03 am
some pointers are missing
I only implemented a few pointer styles (psRectangle, psCircle, psTriangle and psDownTriangle). I see you also use psCross and psStar.
Here I'm adding psCross, psDiagCross and psStar:
Code: Select all
procedure TForm1.Chart1AfterDraw(Sender: TObject);
var R2: TRect;
tmpZ: Integer;
procedure DrawCross;
begin
with Chart1.Canvas do
begin
VertLine3D(R2.Left+(R2.Right-R2.Left) div 2,R2.Top,R2.Bottom,tmpZ);
HorizLine3D(R2.Left,R2.Right,R2.Top+(R2.Bottom-R2.Top) div 2,tmpZ);
end;
end;
procedure DrawDiagonalCross;
begin
with Chart1.Canvas do
begin
LineWithZ(R2.Left,R2.Top,R2.Right,R2.Bottom,tmpZ);
LineWithZ(R2.Right,R2.Top,R2.Left,R2.Bottom,tmpZ);
end;
end;
var i: Integer;
R1: TRect;
maxTitleWidth: Integer;
maxTitleHeight: Integer;
begin
tmpZ:=Round(Chart1.DepthAxis.IAxisSize/2);
maxTitleWidth:=0;
maxTitleHeight:=0;
for i:=0 to Chart1.SeriesCount-1 do
begin
maxTitleWidth:=Max(maxTitleWidth, Chart1.Canvas.TextWidth(Chart1.SeriesTitleLegend(i))+TPoint3DSeries(Chart1[i]).Pointer.Size+15);
maxTitleHeight:=Max(Chart1.Canvas.TextHeight(Chart1.SeriesTitleLegend(i)),TPoint3DSeries(Chart1[i]).Pointer.Size);
end;
R1:=Rect(Chart1.ChartRect.Right+10,Chart1.ChartRect.Top,
Chart1.ChartRect.Right+10+maxTitleWidth,
Chart1.ChartRect.Top+5+Chart1.SeriesCount*(maxTitleHeight+5));
Chart1.Canvas.Rectangle(R1, tmpZ);
R1.Offset(3,5);
for i:=0 to Chart1.SeriesCount-1 do
begin
if Chart1[i] is TPoint3DSeries then
with Chart1.Canvas,TPoint3DSeries(Chart1[i]) do
begin
Pointer.PrepareCanvas(Chart1.Canvas,Color);
R2:=R1;
R2.Width:=Pointer.Size;
R2.Height:=Pointer.Size;
R2.Offset(0,3);
case Pointer.Style of
psRectangle: Cube(R2.Left,R2.Right,R2.Top,R2.Bottom,tmpZ-Pointer.Depth,tmpZ,True,0);
psCircle: Sphere(R2.Left+Pointer.Size div 2,R2.Top+Pointer.Size div 2,tmpZ-Pointer.Depth div 2,Pointer.Size div 2);
psTriangle: Pyramid(True,R2.Left,R2.Top,R2.Right,R2.Bottom,tmpZ-Pointer.Depth,tmpZ,True);
psDownTriangle: Pyramid(True,R2.Left,R2.Bottom,R2.Right,R2.Top,tmpZ-Pointer.Depth,tmpZ,True);
psCross: DrawCross;
psDiagCross: DrawDiagonalCross;
psStar: begin
DrawCross;
DrawDiagonalCross;
end;
psDiamond: ;
psSmallDot: ;
psNothing: ;
psLeftTriangle: ;
psRightTriangle: ;
psHexagon: ;
psVisual: ;
psDonut: ;
psArrow: ;
end;
TextOut3D(R1.Left+Pointer.Size+5,R1.Top,tmpZ,Chart1.SeriesTitleLegend(i));
end;
R1.Offset(0,maxTitleHeight+5);
end;
end;
- Project1_2019-07-03_12-27-37.png (7.34 KiB) Viewed 12765 times