I am visualyzing subsurface borehole data (X,Y,Z) using a TPoint3DSeries. That works fine. However, when I want to display marks with the series that show some text I can only post them above the points. There doesn't seem to be a default option to draw them left or right of a point like there is in Excel (2D) charts.
As most of the boreholes are near vertical this means that the majority of the labels are overlapping and are plotted on top of previous points or labels. Is there a way to solve this?
I have scrutinized answers in the VCL forum but I couldn't find anything that seems to address my particular (3D) problem. Is there a menu setting, or a property setting that I have overlooked? Or is there a way to achieve this in code? If the latter applies, can you point me to an example?
Posting marks left or right for a TPoint3DSeries
-
- Newbie
- Posts: 1
- Joined: Mon Jan 02, 2023 12:00 am
Re: Posting marks left or right for a TPoint3DSeries
Hello Jan,
I'm not sure how are you exactly drawing your
Here what I'm getting:
I'm not sure how are you exactly drawing your
TPoint3DSeries
but here it is an example showing a simple one with all the points with the same XValue
.Here what I'm getting:
Code: Select all
uses TeEngine, Chart, TeePoin3;
var Chart1: TChart;
procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
Chart1:=TChart.Create(Self);
with Chart1 do
begin
Parent:=Self;
Align:=alClient;
Color:=clWhite;
Gradient.Visible:=False;
Walls.Back.Color:=clWhite;
Walls.Back.Gradient.Visible:=False;
Legend.Hide;
//View3D:=False;
Chart3DPercent:=100;
View3DOptions.Orthogonal:=False;
View3DOptions.Zoom:=80;
View3DOptions.Rotation:=360;
View3DOptions.Elevation:=360;
end;
with TPoint3DSeries(Chart1.AddSeries(TPoint3DSeries)) do
begin
Marks.Show;
Marks.Automatic.Move:=False;
Marks.ArrowLength:=10;
LinePen.Hide;
for i:=0 to 19 do
AddXYZ(0, i, random*3);
Chart1.Draw;
OnGetMarkText:=SeriesGetMarkText;
end;
end;
Procedure TForm1.SeriesGetMarkText(Sender:TChartSeries; ValueIndex:Integer; var MarkText:String);
var
APosition: TSeriesMarkPosition;
XPos,YPos: Integer;
const XOff=0;
const YOff=0;
begin
inherited;
with Sender do
begin
APosition:=Marks.Positions[ValueIndex];
if APosition=nil then
begin
APosition:=TSeriesMarkPosition.Create;
APosition.Custom:=True;
end;
XPos:=CalcXPos(ValueIndex);
YPos:=CalcYPos(ValueIndex);
APosition.LeftTop.X:=XPos+Marks.ArrowLength+Round(XOff);
APosition.LeftTop.Y:=YPos-(APosition.Height div 2)+Round(YOff);
APosition.ArrowFrom:=Point(XPos,YPos);
APosition.ArrowTo:=Point(APosition.LeftTop.X+(APosition.Width div 2),APosition.LeftTop.Y+(APosition.Height div 2));
Marks.Positions[ValueIndex]:=APosition;
end;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |