Page 1 of 1
Custom series pointers?
Posted: Thu Jun 22, 2006 9:48 pm
by 9078329
I was wondering how I would go about applying a series with a custom image as a pointer that will display on both the graph and the legend.
I'm also currently running version 6 if that makes any difference.
Posted: Fri Jun 23, 2006 8:35 am
by narcis
Hi Gary,
You can do something like this:
Code: Select all
Private Sub Form_Load()
TChart1.AddSeries scPoint
TChart1.Series(0).FillSampleValues 10
TChart1.Series(0).asPoint.Pointer.Visible = False
End Sub
Private Sub TChart1_OnAfterDraw()
For i = 0 To TChart1.Series(0).Count - 1
X = TChart1.Series(0).CalcXPos(i) - 20
Y = TChart1.Series(0).CalcYPos(i) - 20
TChart1.Canvas.Draw X, Y, Picture1.Picture
Next
End Sub
However, you should manually draw the symbol on the legend. TeeChart Pro v7 ActiveX already includes OnLegendDrawSymbolEvent specially designed for this purpose. An example of the event usage is also included in v7.
Also notice that TeeChart Pro v7 ActiveX includes a set of tools and instructions to automatically upgrade v6 applications to v7.
Posted: Fri Jun 23, 2006 3:36 pm
by 9078329
Thanks NarcĂs. I'm not really sure how to implement this using Visual C++ instead of VB, though. I understand what's going on with the code, I just can't find enough information in the documentation or on the forums to get it up and running.
I found this post and it looks to be similar to what I'm working on
http://www.teechart.net/support/viewtop ... ght=images, but again I'm not really sure how to implement the
ListImages.Add , , LoadPicture . . . in Visual C++.
Any help would be appreciated.
Posted: Mon Jun 26, 2006 8:12 am
by narcis
Hi Gary,
Have you seen the VC++ examples included with TeeChart Pro ActiveX? You'll find them at C:\Program Files\Steema Software\TeeChart Pro v7 ActiveX Control\Examples\Visual C++ (default english installation path).