Page 1 of 1

a problem with LegendScrollBar in Tee-Chart

Posted: Mon Jul 06, 2009 1:23 pm
by 15053610
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

Re: a problem with LegendScrollBar in Tee-Chart

Posted: Tue Jul 07, 2009 7:34 am
by yeray
Hi John,

There is a customer who asked for something similar some time ago. Please, take a look at this topic

Re: a problem with LegendScrollBar in Tee-Chart

Posted: Tue Jul 07, 2009 12:24 pm
by 15053610
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

Re: a problem with LegendScrollBar in Tee-Chart

Posted: Tue Jul 07, 2009 2:29 pm
by yeray
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)