Legend/annotations tied to chart controls shift when printed
Posted: Mon Oct 25, 2004 12:46 pm
The following code displays a chart with open space on the right side and bottom of the chart area. In these open areas, the code displays a text annotation and the legend. When I print the chart from the print button on the TeeCommander bar, the legend and text annotation are not printed in the correct location. From other posts I have seen in the Forums, I tied the legend and text annotation to chart controls in hopes their locations would not shift when printed. Can you help me understand what I'm missing? Thank you so much!
Private Sub Form_Load()
Dim AnnoID As Integer
TeeCommander1.ChartLink = TChart1.ChartLink
With TChart1
.AddSeries (scLine)
.Series(0).FillSampleValues 10
.Panel.MarginUnits = muPercent
.Panel.MarginTop = 20
.Panel.MarginBottom = 20
.Panel.MarginLeft = 0
.Panel.MarginRight = 25
.Legend.Alignment = laBottom
.Legend.Top = TChart1.Axis.Bottom.Position + 300
.Legend.Left = TChart1.Axis.Left.Position + 10
AnnoID = .Tools.Add(tcAnnotate)
With .Tools.Items(AnnoID).asAnnotation
.Text = "Some text."
.Shape.Font.Name = "Ariel"
.Shape.Font.Color = vbBlack
.Shape.Left = TChart1.Axis.Left.Position + 375
.Shape.Top = TChart1.Axis.Top.Position + 100
End With
End With
End Sub[/img]
Private Sub Form_Load()
Dim AnnoID As Integer
TeeCommander1.ChartLink = TChart1.ChartLink
With TChart1
.AddSeries (scLine)
.Series(0).FillSampleValues 10
.Panel.MarginUnits = muPercent
.Panel.MarginTop = 20
.Panel.MarginBottom = 20
.Panel.MarginLeft = 0
.Panel.MarginRight = 25
.Legend.Alignment = laBottom
.Legend.Top = TChart1.Axis.Bottom.Position + 300
.Legend.Left = TChart1.Axis.Left.Position + 10
AnnoID = .Tools.Add(tcAnnotate)
With .Tools.Items(AnnoID).asAnnotation
.Text = "Some text."
.Shape.Font.Name = "Ariel"
.Shape.Font.Color = vbBlack
.Shape.Left = TChart1.Axis.Left.Position + 375
.Shape.Top = TChart1.Axis.Top.Position + 100
End With
End With
End Sub[/img]