Pictures on Gantt Charts

TeeChart for ActiveX, COM and ASP
Post Reply
JD
Newbie
Newbie
Posts: 7
Joined: Fri Jun 06, 2008 12:00 am
Contact:

Pictures on Gantt Charts

Post by JD » Fri Sep 19, 2008 2:28 pm

In our project we have a gantt chart. Each Bar is standing for another Person with a special job. Now we need to add to the bars picture, every picture will stand for the persons job and the picture should be visible in the first quarter of a bar.
Is there a simple solution to reach this?

greetings

JD

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

Post by Pep » Mon Sep 22, 2008 8:45 am

Hello,

there's not a way to it automatically through methods and properties, but it can be accomplished by drawing directly onto the canvas using the Draw method. Here I show an example which draws an image into the first gantt bar :

Code: Select all

Private Sub TChart1_OnAfterDraw()
' This will add image for first gant....
TChart1.Canvas.Draw TChart1.Axis.Bottom.CalcXPosValue(TChart1.Series(0).XValues.Value(0)), _
                    TChart1.Axis.Left.CalcYPosValue(TChart1.Series(0).YValues.Value(0)) - _
                    TChart1.Series(0).asGantt.Pointer.VerticalSize / 2, _
                    Image1.Picture
End Sub

JD
Newbie
Newbie
Posts: 7
Joined: Fri Jun 06, 2008 12:00 am
Contact:

Post by JD » Mon Sep 29, 2008 1:50 pm

Works Great.
But now I have the problem that the images are also on the non charted area and I dont know how to use the ClipRectangle Function. Can you give just an example?

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

Post by Narcís » Mon Sep 29, 2008 1:53 pm

Hi JD,

You'll find an example of ClipRectangle's usage here.

Hope this helps!
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

JD
Newbie
Newbie
Posts: 7
Joined: Fri Jun 06, 2008 12:00 am
Contact:

Post by JD » Mon Sep 29, 2008 2:39 pm

Now it's working. But next Problem how can I make the Images on the Gantt transperance?

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

Post by Pep » Mon Oct 06, 2008 7:39 am

Hello,

I'm afraid this is not going to be possible, as the Draw method does not include transparency support. We'll add on our wish list to be considered for further releases.

Post Reply