Page 1 of 1

Display Icons in a Custom Image Point Series

Posted: Mon Jan 21, 2008 12:32 pm
by 15047072
I'm working in VB6 and want to display timed events as icons along the top horizontal Axis of a graph which also records temperature and Pressure over time.

If I use an image point series, can I set a custom Icon at run time depending on the type of event?
I have a list view of the data which uses icons from an imagelist control, and would want to use the same icons. It looks as if this should be possible, but I can't find anything in the tutorials/help

Many Thanks

Posted: Tue Jan 22, 2008 10:21 am
by yeray
Hi DraegerSoft,

If I understand well you could use a method like following:

Code: Select all

Private Sub paint(num As Integer)
  TChart1.Series(0).asImagePoint.ImagePoint.AssignImage ImageList1.ListImages.Item(num).Picture
End Sub
and call it in all the events you need with the parameter you want. For example, if you want to show the first image from the list when OnClick event is fired:

Code: Select all

Private Sub TChart1_OnClick()
  paint 1
End Sub
You could also take a look at those two demos where imagelists are used too:
Whats New->New Features->Canvas->Custom Shape->Picture
All Features->Miscellaneous>Legend->Symbol OnDraw