Point mark when point is visible

TeeChart for ActiveX, COM and ASP
Post Reply
Raymond
Newbie
Newbie
Posts: 27
Joined: Tue Dec 02, 2008 12:00 am

Point mark when point is visible

Post by Raymond » Tue Nov 30, 2010 5:45 pm

Hi,

Is there a way to make the mark of a point visible if and only if the point is visible on the graph?
Label_Overrun.jpg
Label_Overrun.jpg (190.33 KiB) Viewed 7489 times
In the image above, the mark [357.5] still shows even when the point is no longer visible on the graph. I tried clipping; however, it clips the mark. What I want to do is to not show the mark if the point is no longer visible.

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

Re: Point mark when point is visible

Post by Narcís » Wed Dec 01, 2010 9:23 am

Hi Raymond,

Have you tried clipping marks?

Code: Select all

    TChart1.Series(0).Marks.Clip = True
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

Raymond
Newbie
Newbie
Posts: 27
Joined: Tue Dec 02, 2008 12:00 am

Re: Point mark when point is visible

Post by Raymond » Wed Dec 01, 2010 4:35 pm

I tried that. The problem is it clips the marks. What I want to do is to not show the mark if the point is no longer visible on the graph. However, if the point is still visible, even though the mark will be off the graph, I still want to show the mark.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Point mark when point is visible

Post by Sandra » Fri Dec 03, 2010 10:25 am

Hello Rymond,

Ok. I made a simple code that uses method of series CalcYPos(i). I think you can use it for solve your problem with marks in your application. Moreover we can added it request in wish-list with number (TV52015303) to be enhanced for next releases.

Code: Select all

Private Sub Form_Load()
    TChart1.Aspect.View3D = False
    TChart1.AddSeries scLine
    TChart1.Series(0).FillSampleValues 25
    TChart1.Series(0).Marks.Visible = True
End Sub
Private Sub TChart1_OnAfterDraw()

    Dim yPos As Integer
    For i = 0 To TChart1.Series(0).Count - 1
        yPos = TChart1.Series(0).CalcYPos(i)
        With TChart1.Series(0).Marks
            If (yPos < TChart1.Axis.Left.IStartPos) Or (yPos > TChart1.Axis.Left.IEndPos) Then
                .Item(i).Hide

            Else
                .Item(i).Show
            End If
        End With
    Next
End Sub
I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / 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