Dear TeeChart-Supports,
We faced up to a issues about show dragmarks in Bar Chart as below:
1. Before refresh chart, we backup all dragmarks(width, height, arrow from position)
2. After refresh chart, we restore these previous dragmarks as below:
with DragMarkInfo.Series.Marks.Positions.Position[PositionIndex] do
begin
Custom := True;
ArrowFrom.X := DragMarkInfo.Series.CalcXPos(PositionIndex);
ArrowFrom.Y := DragMarkInfo.Series.CalcYPos(PositionIndex);
ArrowTo.X := StrToInt(ArrowToXPositionArray[PositionIndex]);
ArrowTo.Y := StrToInt(ArrowToYPositionArray[PositionIndex]);
LeftTop.X := StrToInt(ArrowToXPositionArray[PositionIndex]) -
(StrToInt(WidthArrowArray[PositionIndex]) div 2);
LeftTop.Y := StrToInt(ArrowToYPositionArray[PositionIndex]) -
StrToInt(HeightArrowArray[PositionIndex]);
Width := StrToInt(WidthArrowArray[PositionIndex]);
Height := StrToInt(HeightArrowArray[PositionIndex]);
end;
Although, in Bar Chart the following code returned wrong position. The ArrowTo position drew at lefttop of Bar Series (not middle on top of Bar Seriese).
ArrowFrom.X := DragMarkInfo.Series.CalcXPos(PositionIndex);
ArrowFrom.Y := DragMarkInfo.Series.CalcYPos(PositionIndex);
Could you please tell me how to show dragmarks in correctly position (the same as when we choose show dragmarks on Bar Series - at middle on top of Bar Series)?
Thank in advances.
SIA.
Show dragmarks in Bar Chart
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi SIA,
You can try centering arrows using this code:
Hope this helps!
You can try centering arrows using this code:
Code: Select all
ArrowFrom.X := DragMarkInfo.Series.CalcXPos(PositionIndex) + ((DragMarkInfo[0] as TBarSeries).BarWidth div 2);
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 |