Canvas disappears

TeeChart for ActiveX, COM and ASP
Post Reply
Activex
Newbie
Newbie
Posts: 4
Joined: Thu Dec 06, 2001 5:00 am
Location: Brazil
Contact:

Canvas disappears

Post by Activex » Wed Sep 05, 2007 7:20 pm

Sirs,

I drew a legend in the graph when I clicked in one point.
I'm using canvas, but when I changed the focus to another form, my legend disappear.

Or when I scroll the graph the legend disappear too.

Can You help me?

Igor

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Sep 06, 2007 8:32 am

Hi Igor,

Could you please send us a simple example project we can run "as-is" to reproduce the problem here?

You can post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Activex
Newbie
Newbie
Posts: 4
Joined: Thu Dec 06, 2001 5:00 am
Location: Brazil
Contact:

Canvas disappears

Post by Activex » Thu Sep 06, 2007 5:55 pm

Narcís,

I drew a Line diagonally from top left to bottom right, using the code above:
With TChart1
.Canvas.MoveTo .Axis.Left.Position, .Axis.Top.Position
.Canvas.LineTo .Axis.Right.Position, .Axis.Bottom.Position
End With

But when I scrolled the graph, the line disappears.

Can you help me fixed this?

Thanks,

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Sep 07, 2007 8:15 am

Hi Igor,

You need to use this code in the OnAfterDraw event:

Code: Select all

Private Sub TChart1_OnAfterDraw()
    With TChart1
        .Canvas.MoveTo .Axis.Left.Position, .Axis.Top.Position
        .Canvas.LineTo .Axis.Right.Position, .Axis.Bottom.Position
    End With
End Sub
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply