still having annotation printing problems
still having annotation printing problems
i put the calcxpos & calcypos calls in OnBeforeDrawSeries, used the results to Move the annotaions, the Print Preview shows the annotations and callouts correctly positioned but the printout prints them offset, looks like about consistently -300pixels in the x and -300 pixels in the y (- to the Left & Top).......I checked the event, the OnBeforeDrawSeries event is only fired AFTER the print job is spooled and actually over. So this does help move the annotation but only with respect to the screen, not the printer.......
Hi,
in order for the Annotation Tools to print in the correct position you have to define their positions relative to other TeeChart objects and not as absolute pixel positions. Unfortunately the default positions are absolute pixel positions and so can't be used to print Charts - if you want to print an Annotation Tool in the ppLeftTop position, for example, you'll have to use code similar to the following (to see this work please create an .exe file from your VB project and print from there):
in order for the Annotation Tools to print in the correct position you have to define their positions relative to other TeeChart objects and not as absolute pixel positions. Unfortunately the default positions are absolute pixel positions and so can't be used to print Charts - if you want to print an Annotation Tool in the ppLeftTop position, for example, you'll have to use code similar to the following (to see this work please create an .exe file from your VB project and print from there):
Code: Select all
Private Sub Command1_Click()
TChart1.Printer.ShowPreview
End Sub
Private Sub Form_Load()
With TChart1
.AddSeries scLine
.Series(0).FillSampleValues 10
.Tools.Add tcAnnotate
With .Tools.Items(0).asAnnotation
.Text = "HELLO"
End With
End With
End Sub
Private Sub TChart1_OnBeforeDrawSeries()
With TChart1
With .Tools.Items(0).asAnnotation
.Shape.CustomPosition = True
.Shape.Left = TChart1.Axis.Left.Position - 30
.Shape.Top = TChart1.Axis.Top.Position - 30
End With
End With
End Sub
Pep Jorge
http://support.steema.com
http://support.steema.com