Page 1 of 1

images in TChart

Posted: Wed Feb 01, 2006 4:06 pm
by 9079987
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

Posted: Fri Feb 03, 2006 5:21 pm
by Pep
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.

Posted: Tue Feb 07, 2006 7:53 am
by 9079987
[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...

Posted: Wed Feb 08, 2006 8:48 am
by Pep
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.