Hiding Points in a Series

TeeChart for ActiveX, COM and ASP
Post Reply
DLauben
Newbie
Newbie
Posts: 2
Joined: Wed Nov 10, 2021 12:00 am

Hiding Points in a Series

Post by DLauben » Fri Nov 12, 2021 1:32 am

Is there a way to hide one or more points in a series. For instance, let's say I have 4 series of 12 points each. Can I have a chart that show only points 1 thru 3 for the 1st series, 4 thru 6 for the 2nd, etc.

If there's a functionality or property that controls this please advise.

Thanks in advance,

Dave

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

Re: Hiding Points in a Series

Post by Yeray » Fri Nov 12, 2021 10:23 am

Hello Save,

Yes, you can hide specific points by setting them as "null points". Ie:

Code: Select all

Private Sub Form_Load()
  With TChart1
    .Aspect.View3D = False
    .Legend.Visible = False
    .Panel.Gradient.Visible = False
    .Panel.Color = vbWhite
    .Walls.Back.Gradient.Visible = False
    .Walls.Back.Color = vbWhite
    .Axis.Left.GridPen.Visible = False
    .Axis.Bottom.GridPen.Visible = False
    
    Dim i, j As Integer
    For i = 0 To 3
      .AddSeries scPoint
      .Series(i).FillSampleValues 12
      For j = 0 To .Series(i).Count - 1
        If (j < i * 3) Or (j >= (i + 1) * 3) Then
          .Series(i).SetNull j
        End If
      Next j
    Next i
  End With
points.png
points.png (4.51 KiB) Viewed 370 times
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

DLauben
Newbie
Newbie
Posts: 2
Joined: Wed Nov 10, 2021 12:00 am

Re: Hiding Points in a Series

Post by DLauben » Sat Nov 13, 2021 2:11 am

Thank you Yeray. That worked perfectly. Much appreciate -- both your explanation and timely reply.

I now know to look at the .SetNull functionality. Before your reply, I was thinking it would be something like a 'hidden' attribute, but now I now that wasn't the way to go.

Best,

Dave L.

Post Reply