Page 1 of 1

Help - Quantity of data to delete must be less than Count

Posted: Thu Jun 27, 2013 6:02 am
by 16665336
We were using TeeChart6 activex control and shifted to TeeChart2013 just for the sake of getting TeeChart work on 64 bit systems.

Problem - We keep adding data for line graph every second. When it reaches more than 15000 X-axis elements we delete the first point and add new point at the end for sake of displaying latest data. It used to work fine in TChart6 but as soon as we shifted to TChart2013 and kept it for overnight test it started to display message "Quantity of data to delete must be less than Count" for infinite times.
Check the attached jpg file.

We have been using TChart6 for more than 5 years but we did not get such errors at all.

Please give us solution ASAP as customer is waiting for the fix.

Re: Help - Quantity of data to delete must be less than Count

Posted: Thu Jun 27, 2013 10:20 am
by narcis
Jagdish wrote: Problem - We keep adding data for line graph every second. When it reaches more than 15000 X-axis elements we delete the first point and add new point at the end for sake of displaying latest data. It used to work fine in TChart6 but as soon as we shifted to TChart2013 and kept it for overnight test it started to display message "Quantity of data to delete must be less than Count" for infinite times.
Check the attached jpg file.
This exception is thrown in the Delete method, which deletes Quantity number of points from Start index, when (Start+Quantity-1) < Count. This error message would indicate that you are trying to remove more points that those existing in the series. I have done some tests here and it works fine. Can you please check that this is not the case? If the problem persists please attach a simple example project we can run "as-is" to reproduce the problem here.

Thanks in advance.
Jagdish wrote:Please give us solution ASAP as customer is waiting for the fix.
In that case you might be interested in the Pro Support service explained here.

Re: Help - Quantity of data to delete must be less than Count

Posted: Fri Jun 28, 2013 5:50 am
by 16665336
I have handled the situation using below DeleteSeriesAt function, but then too i am getting the same error

where
int nSeries = series index
int Idx = start index
int iDeleteCount = delete count

ABS = is a local function which returns positive value

Code: Select all

void CGLTChart::DeleteSeriesAt(int nSeries,int Idx, int iDeleteCount)
{
  int iValCount = Series(nSeries).GetCount();
  int iPointsToDelete = ABS(iValCount-Idx);

  if ( iDeleteCount >= iPointsToDelete )
  {
    iDeleteCount = iPointsToDelete-1;
  }

  if ( iDeleteCount > 0 )
  {
    Series(nSeries).DeleteRange(Idx, iDeleteCount);
  }
}
Am I doing something wrong here?

Re: Help - Quantity of data to delete must be less than Count

Posted: Fri Jun 28, 2013 7:02 am
by narcis
Hello,

This code looks fine to me. Can you please arrange a simple example project we can run "as-is" to reproduce the problem here?

Thanks in advance.