Bug when using paging?

TeeChart for ActiveX, COM and ASP
Post Reply
n00b
Newbie
Newbie
Posts: 8
Joined: Mon Nov 30, 2009 12:00 am

Bug when using paging?

Post by n00b » Mon Dec 14, 2009 3:34 am

I'm adding 2 series to the chart - a bar and line series. I've also enabled paging so I can scroll through the data.

I've noticed that when the last page only has 1 data item (e.g. 21 items with 10 items per page would mean the third page only has 1 item on it) then the values for ALL the columns appear on the last item.

I've taken a very small snippet of the chart with the last item on the last page appearing. You can see that with the markings enabled, there is numerous markers for the last bar + line series.

Is this a known issue and will it be fixed? Is there some kind of use able work-around for it?

Thank you
Attachments
Untitled.jpg
Untitled.jpg (37.88 KiB) Viewed 5731 times

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

Re: Bug when using paging?

Post by Yeray » Mon Dec 14, 2009 11:13 am

Hi

I could reproduce it and I've added this to the bug list to be fixed in future releases (TV52014593).
Note that there is another (known, TV52014098) problem that is that the first bar of the "next" page is partially shown (and also the last bar of the "previous" page).

The a workaround for both problems consist on hiding the bars that you don't want to be drawn setting them as null points:

Code: Select all

Private Sub Form_Load()
  TeeCommander1.Chart = TChart1
 
  TChart1.Aspect.View3D = False
  TChart1.AddSeries scBar
  
  TChart1.Series(0).FillSampleValues 11
  
  TChart1.Page.MaxPointsPerPage = 2
  
  SetNulls
End Sub

Private Sub Next_Click()
  TChart1.Page.Next
    
  SetNulls
End Sub

Private Sub Previous_Click()
  TChart1.Page.Previous
  
  SetNulls
End Sub

Private Sub SetNulls()
  Dim i As Integer
  For i = 0 To TChart1.Series(0).Count - 1
    TChart1.Series(0).PointColor(i) = TChart1.Series(0).Color
  Next i
  
  If TChart1.Page.Current > 1 And TChart1.Page.Current <> TChart1.Page.Count Then
    TChart1.Series(0).SetNull (TChart1.Page.Current - 1) * TChart1.Page.MaxPointsPerPage - 1
  End If
  
  If TChart1.Page.Current < TChart1.Page.Count Then
    TChart1.Series(0).SetNull (TChart1.Page.Current) * TChart1.Page.MaxPointsPerPage
  End If
  
  If TChart1.Page.Current = TChart1.Page.Count And TChart1.Series(0).Count Mod TChart1.Page.MaxPointsPerPage = 1 Then
    For i = 0 To TChart1.Series(0).Count - 2
      TChart1.Series(0).SetNull i
    Next i
  End If
End Sub
Note that another possibility would stop using TeeChart paging feature and doing it manually with SetMinMax function. This would work around the problem with the last page with a unique bar, but not with the other problem.
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: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Bug when using paging?

Post by Yeray » Thu Sep 30, 2010 1:12 pm

Hello,

I've checked this with the TeeChart ActiveX v2010 Beta recently published and I can confirm that both problems have been solved with it.
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