I have an annotation placed in a very specific point basec on X Y values for a series. When the user zoom - the annotaion remains in the same location and is pointing to an invalid location.
I use use :
//
FSessionZoneNames.Shape.Left := DBChartSession.LeftAxis.PosAxis;
FSessionZoneNames.Shape.Top := SeriesHR.CalcYPosValue(FieldByName('high').AsInteger);
//
to get the orginal locations but after zooming the result is incorrect, Recreating after the zoom works but is not what is required.
Any ideas...
Annotation Tool and relocation after zooming the chart
More of the same
When resizing the form, the same happens - the annotation floats in teh middle on nowhere. is there no way to keep it relative to the correct location
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi JC,
I have posted an example project trying to reproduce what you descrive. Is this the behaviour you get? If not could you please modify the project to reproduce what you are reporting?
The sample project is posted at steema.public.attachments newsgroups.
I have posted an example project trying to reproduce what you descrive. Is this the behaviour you get? If not could you please modify the project to reproduce what you are reporting?
The sample project is posted at steema.public.attachments newsgroups.
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 |
Hi.
The following code, placed in chart OnBeforeDrawSeries event should work fine:
The following code, placed in chart OnBeforeDrawSeries event should work fine:
Code: Select all
procedure TForm1.Chart1BeforeDrawSeries(Sender: TObject);
begin
With annotateTool1.Shape do
begin
CustomPosition := True;
Left := Chart1.Axes.Left.PosAxis;
Top := Chart1.Axes.Left.CalcYPosValue(your_y_value);
end;
end;
Marjan Slatinek,
http://www.steema.com
http://www.steema.com
Now i have a serious Exception
Putting the code in OnBeforeDrawSeries works but I am getting exceptions that killing the chart + app.I use wrapper routines to hide and shwo zone overlays as follows:
the line causes the exception.
Help is appreciated
Thanks
Code: Select all
procedure TViewAnalyzer.HideZoneOverlay;
var
i : integer;
begin
for i := 0 to 19 do
begin
if (FSessionZoneBands[i] <> nil) then
begin
DBChartSession.Tools.Remove(FSessionZoneBands[i]);
FSessionZoneBands[i].Free;
FSessionZoneBands[i] := nil;
end;
if (FSessionZoneNames[i] <> nil) then
begin
DBChartSession.Tools.Remove(FSessionZoneNames[i]);
FSessionZoneNames[i].Free;
FSessionZoneNames[i] := nil;
end;
end;
end;
Code: Select all
"FSessionZoneNames[i].Free;"
Help is appreciated
Thanks