Show in TeeListBox

TeeChart for ActiveX, COM and ASP
Post Reply
ACC
Newbie
Newbie
Posts: 12
Joined: Fri Oct 21, 2005 4:00 am

Show in TeeListBox

Post by ACC » Mon Apr 23, 2007 3:19 pm

Hi

Simple question, exists a property or method that allows hide or show a serie in the TeeListBox as ShowInLegend property of ISeries ??

Thanks in advance.

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Tue Apr 24, 2007 9:38 am

Hi ACC,

There's no method to show/hide series individually from a TeeListBox yet but you can assign a group to the TeeListBox. So you can create your custom group and the TeeListBox will only show the series you wish.

At the following example I use ComboBoxes to select the series to show. But note that in each ComboBox I delete and create again the SeriesGroup:

Code: Select all

Private Sub Check1_Click()
  TChart1.SeriesList.Groups.Delete 0
  TChart1.SeriesList.AddGroup "Group 0"
  
  If Check1.Value Then
    TChart1.SeriesList.Groups.Items(0).Add 0
  End If
  
  If Check2.Value Then
    TChart1.SeriesList.Groups.Items(0).Add 1
  End If
  
  TeeListBox1.SeriesGroup = TChart1.SeriesList.Groups.Items(0)
  TeeListBox1.UpdateSeries
End Sub

Private Sub Check2_Click()
  TChart1.SeriesList.Groups.Delete 0
  TChart1.SeriesList.AddGroup "Group 0"
  
  If Check1.Value Then
    TChart1.SeriesList.Groups.Items(0).Add 0
  End If
  
  If Check2.Value Then
    TChart1.SeriesList.Groups.Items(0).Add 1
  End If
  
  TeeListBox1.SeriesGroup = TChart1.SeriesList.Groups.Items(0)
  TeeListBox1.UpdateSeries
End Sub

Private Sub Form_Load()
  TChart1.AddSeries scBar
  TChart1.AddSeries scBar
  
  TChart1.Series(0).FillSampleValues
  TChart1.Series(1).FillSampleValues

  TChart1.SeriesList.AddGroup "Group 0"
  
  'you should set the ComboBoxes to Checked by default
  TChart1.SeriesList.Groups.Items(0).Add 0
  TChart1.SeriesList.Groups.Items(0).Add 1

  TeeListBox1.Chart = TChart1
  TeeListBox1.SeriesGroup = TChart1.SeriesList.Groups.Items(0)
End Sub
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Post by Yeray » Tue Apr 24, 2007 11:16 am

And I can announce the new property "Items" for TeeListBoxes, available for the next release v8. So you will be able to do:

Code: Select all

TeeListBox1.Items.Remove (0)
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

ACC
Newbie
Newbie
Posts: 12
Joined: Fri Oct 21, 2005 4:00 am

Post by ACC » Tue Apr 24, 2007 7:59 pm

Thank you very much.

Saludos

Post Reply