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

TeeChart for ActiveX, COM and ASP
Post Reply
Jagdish
Newbie
Newbie
Posts: 4
Joined: Wed Mar 06, 2013 12:00 am

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

Post by Jagdish » Thu Jun 27, 2013 6:02 am

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.
Attachments
TChartError.jpg
Displayed error message
TChartError.jpg (20.69 KiB) Viewed 8492 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

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

Post by Narcís » Thu Jun 27, 2013 10:20 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Jagdish
Newbie
Newbie
Posts: 4
Joined: Wed Mar 06, 2013 12:00 am

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

Post by Jagdish » Fri Jun 28, 2013 5:50 am

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?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

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

Post by Narcís » Fri Jun 28, 2013 7:02 am

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.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply