images in TChart

TeeChart for ActiveX, COM and ASP
Post Reply
Newbie
Newbie
Posts: 2
Joined: Thu Nov 27, 2003 5:00 am
Contact:

images in TChart

Post by » Wed Feb 01, 2006 4:06 pm

Hi Folks.

I want to display different icons in the TChart. I'm currently running Version 6.0.0.5 In the forum I found something like ImagePoint but this seems to be only available in V7 ? Is there another solution? I also played around with Canvas:StretchDraw but with Canvas I cant display anything at all (are the Top,Left,Bottom,Right positions the X-Y-Coordinates or Coordinates relative to the screen?).

thx in advance

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

Post by Pep » Fri Feb 03, 2006 5:21 pm

Hi,

using the latest maintenance release of the TeeChart Pro v6 you can assign images to the pointers using similar code to the following :

Code: Select all

Private Sub Form_Load()
  TeeCommander1.Chart = TChart1
  Dim myPath

  With TChart1
    .Aspect.View3D = False
    .AddSeries scPoint
    .Series(0).FillSampleValues 10
    
    myPath = "C:\Archivos de Programa\Steema Software\TeeChart Pro v6 ActiveX Control\Examples\Visual Basic\TeeChartAXV6Demo\BrushStyles"
    
    ImageList1.ListImages.Add , , LoadPicture(myPath & "\TeeBrush1.bmp")
    ImageList1.ListImages.Add , , LoadPicture(myPath & "\TeeBrush2.bmp")
    ImageList1.ListImages.Add , , LoadPicture(myPath & "\TeeBrush3.bmp")
    ImageList1.ListImages.Add , , LoadPicture(myPath & "\TeeBrush4.bmp")
    .Series(0).asPoint.Pointer.VerticalSize = 10
    .Series(0).asPoint.Pointer.HorizontalSize = 10
  End With
End Sub


Private Sub TChart1_OnGetSeriesPointerStyle(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, AStyle As TeeChart.EPointerStyle)
TChart1.Series(0).asPoint.Pointer.Brush.Color = vbYellow
If ValueIndex + 1 = 1 Then
    TChart1.Series(0).asPoint.Pointer.Brush.AssignImage ImageList1.ListImages.Item(1).Picture
Else
    TChart1.Series(0).asPoint.Pointer.Brush.AssignImage ImageList1.ListImages.Item(4).Picture
End If
End Sub
Canvas:StretchDraw but with Canvas I cant display anything at all (are the Top,Left,Bottom,Right positions the X-Y-Coordinates or Coordinates relative to the screen?).
The coordinates are relative to the TeeChart object, in the case you want to draw any object into the teechart canvas the best way is to place the custom objects relative to the teechart objects (axis, labels, series, etc..), this will allow to do a zoom and scroll with these custom objects.

Newbie
Newbie
Posts: 2
Joined: Thu Nov 27, 2003 5:00 am
Contact:

Post by » Tue Feb 07, 2006 7:53 am

[quote="Pep"]Hi,

using the latest maintenance release of the TeeChart Pro v6 you can assign images to the pointers...
[/code]

Hi Pep.

Thanks for your reply. I already tried it that way before. But I have the following problem: If I use a small image (like an icon) the image isnt centered/filled inside the Point I added but painted (virtually) over and over to fill the whole TChart. So the image doesnt fit inside the Point but I randomly see only some part of the image...

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

Post by Pep » Wed Feb 08, 2006 8:48 am

Hi,

yes, this feature is not available (allow to stretch the image in the
pointer), it's on our wish list to be considered for further releases.

Post Reply