a problem with LegendScrollBar in Tee-Chart

TeeChart for ActiveX, COM and ASP
Post Reply
swiking
Newbie
Newbie
Posts: 2
Joined: Tue Jun 30, 2009 12:00 am

a problem with LegendScrollBar in Tee-Chart

Post by swiking » Mon Jul 06, 2009 1:23 pm

Hi, there,

I have a problem with the new tee-chart.

If the legend has too many items to be viewed in a plot. I can add a LegendScrollBar beside it use code like this:
long index = m_TChart.GetTools().Add(tcLegendScrollBar);

But when the items in the legend are all visible, I don't need the scrollbar to be visible.

Is there any clever way to do that? Or Tee-CHart does not support this function yet.

Thanks in advance.

Best,
John Fields

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

Re: a problem with LegendScrollBar in Tee-Chart

Post by Yeray » Tue Jul 07, 2009 7:34 am

Hi John,

There is a customer who asked for something similar some time ago. Please, take a look at this topic
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

swiking
Newbie
Newbie
Posts: 2
Joined: Tue Jun 30, 2009 12:00 am

Re: a problem with LegendScrollBar in Tee-Chart

Post by swiking » Tue Jul 07, 2009 12:24 pm

Thanks for the reply.

The strategy in the post you mentioned seems fine.

But there's another problem in my application:

TChart1.Series(0).Count (vb)
int nSeries = tcTmp->GetSeriesCount(); (vc)

the number returned is usually bigger than the number of series names in legend. because some series are not visible in the legend. They are always visible thus do not need to appear in the legend.

Could you make a comment on this scenario?

thanks in advance.

best,
john

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

Re: a problem with LegendScrollBar in Tee-Chart

Post by Yeray » Tue Jul 07, 2009 2:29 pm

Hi John,

if you are trying to check the active series in a chart you'll have to loop into the series list and count the active by yourself because the count property gives you the number of items in the list, not only the actives:

Code: Select all

  Dim ActiveSeries As Integer
  ActiveSeries = 0
  
  Dim i As Integer
  For i = 0 To TChart1.SeriesCount - 1
    If TChart1.Series(i).Active Then
      ActiveSeries = ActiveSeries + 1
    End If
  Next i
  
  TChart1.Header.Caption = Str$(ActiveSeries)
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

Post Reply