Problem with clicking marks

TeeChart for ActiveX, COM and ASP
Post Reply
Gottkehaskamp
Newbie
Newbie
Posts: 3
Joined: Wed Sep 09, 2015 12:00 am

Problem with clicking marks

Post by Gottkehaskamp » Tue Jan 19, 2016 7:55 am

Hi,

I have a series of points. To show some supportive information to them, the marks pop up and disappear by clicking these points.
My problem is now if a marks box covers another point, it is not possible to show the marks of this other point afterwards.
How can I solve this problem?

Many thanks in advance!

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

Re: Problem with clicking marks

Post by Yeray » Tue Jan 19, 2016 9:16 am

Hello,

Are you using the MarkTips tool? Are you using it with MouseAction = mtmClick?
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

Gottkehaskamp
Newbie
Newbie
Posts: 3
Joined: Wed Sep 09, 2015 12:00 am

Re: Problem with clicking marks

Post by Gottkehaskamp » Sun Jan 31, 2016 3:56 pm

Hi,

thanks for your answer.
I am just using a series of points. I make the points visible by an OnMouseDown event.

Thanks!

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

Re: Problem with clicking marks

Post by Yeray » Mon Feb 01, 2016 10:16 am

Hello,

I've made a simple example in VB6 to check this.
I'm using OnClickSeries event instead of OnMouseDown event because you already have the ValueIndex with the former.
As you say, if a mark is over a series point, the mouse click event is captured by the mark and doesn't go through it to reach the series point.
However using a tcDragMarks you can move the overlapping mark to make the point to be clicked accessible again.

Code: Select all

Private Sub Form_Load()
  TChart1.Aspect.View3D = False
  TChart1.Zoom.Enable = False
  TChart1.Scroll.Enable = pmNone
  
  TChart1.AddSeries scPoint
  TChart1.Series(0).FillSampleValues 10
  
  TChart1.Tools.Add tcDragMarks
  
  TChart1.Series(SeriesIndex).Marks.Visible = True
  Dim i As Integer
  For i = 0 To TChart1.Series(0).Count - 1
    TChart1.Series(0).Marks.Item(i).Visible = False
  Next i
End Sub

Private Sub TChart1_OnClickSeries(ByVal SeriesIndex As Long, ByVal ValueIndex As Long, ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
  If SeriesIndex > -1 And SeriesIndex < TChart1.SeriesCount Then
    If ValueIndex > -1 And ValueIndex < TChart1.Series(SeriesIndex).Count Then
      TChart1.Series(SeriesIndex).Marks.Item(ValueIndex).Visible = Not TChart1.Series(SeriesIndex).Marks.Item(ValueIndex).Visible
    End If
  End If
End Sub
You could also try to avoid the overlapping manually. Here you can find some references:
http://www.teechart.net/support/viewtop ... ap*#p47893
http://www.teechart.net/support/viewtop ... ap*#p46555
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