Page 1 of 1

Problem with clicking marks

Posted: Tue Jan 19, 2016 7:55 am
by 16676296
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!

Re: Problem with clicking marks

Posted: Tue Jan 19, 2016 9:16 am
by yeray
Hello,

Are you using the MarkTips tool? Are you using it with MouseAction = mtmClick?

Re: Problem with clicking marks

Posted: Sun Jan 31, 2016 3:56 pm
by 16676296
Hi,

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

Thanks!

Re: Problem with clicking marks

Posted: Mon Feb 01, 2016 10:16 am
by yeray
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