Printing problem in TeeChart ActiveX V. 6

TeeChart for ActiveX, COM and ASP
Post Reply
Nitin
Newbie
Newbie
Posts: 7
Joined: Thu Jan 09, 2003 5:00 am

Printing problem in TeeChart ActiveX V. 6

Post by Nitin » Thu Feb 17, 2005 4:45 am

Hi

I am having problem in previewing and printing the chart in TeeChart ActiveX 6. I have used two controls and I use Tee Preview Panel for preview and printing. My chart is generally drawn with many annotation tools. The problem is, when I use landscape orientation, it gives perfect result but when I change orientation to portrait it disturbs whole chart image and distorts everything. In short, the output doesn't remains as it displays on the screen.

Is there anything to take care while changing orientation ? Please help me.

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Fri Feb 18, 2005 12:13 pm

Hi Nitin,

in order for custom objects 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

Post Reply