cursor position on chart

  • Thread starter Thread starter Vergassivellaunus
  • Start date Start date
V

Vergassivellaunus

Guest
I have a chart with a line graph.

If I write:

Private Sub Chart1_MouseDown(sender As Object, e As MouseEventArgs) Handles Chart1.MouseDown

x = Me.Chart1.ChartAreas(0).CursorX.Position
y = Me.Chart1.ChartAreas(0).CursorY.Position

end sub

when i do mouse down i read x but y=NaN. Why this ?

If I write:

Private Sub Chart1_MouseDown(sender As Object, e As MouseEventArgs) Handles Chart1.MouseDown

Me.Chart1.ChartAreas(0).CursorX.SetCursorPixelPosition(New PointF(e.X, e.Y), False)
Me.Chart1.ChartAreas(0).CursorY.SetCursorPixelPosition(New PointF(e.X, e.Y), False)
x = Me.Chart1.ChartAreas(0).CursorX.Position
y = Me.Chart1.ChartAreas(0).CursorY.Position

end sub

whith mouse down i read x and y, but only integers. I need to read them as real numbers.

Continue reading...
 

Similar threads

V
Replies
0
Views
150
Vergassivellaunus
V
V
Replies
0
Views
154
Vergassivellaunus
V
V
Replies
0
Views
156
Vergassivellaunus
V
V
Replies
0
Views
116
Vergassivellaunus
V
V
Replies
0
Views
108
Vergassivellaunus
V
Back
Top