/
Window1.xaml.vb
38 lines (30 loc) · 1.09 KB
/
Window1.xaml.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Imports Microsoft.VisualBasic
Imports System.Windows
Imports System.Windows.Controls.Primitives
Imports System.Windows.Input
Imports DevExpress.Xpf.Charts
Namespace DXChartsTooltips
Partial Public Class Window1
Inherits Window
Public Sub New()
InitializeComponent()
End Sub
Private Sub chartControl1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs)
Dim hitInfo As ChartHitInfo = chartControl1.CalcHitInfo(e.GetPosition(chartControl1))
If hitInfo IsNot Nothing AndAlso hitInfo.SeriesPoint IsNot Nothing Then
Dim point As SeriesPoint = hitInfo.SeriesPoint
tooltip_text.Text = String.Format("Series = {0}" & Constants.vbLf & "Argument = {1}" & _
Constants.vbLf & "Value = {2}", point.Series.DisplayName, point.Argument, point.Value)
tooltip1.Placement = PlacementMode.Mouse
tooltip1.IsOpen = True
Cursor = Cursors.Hand
Else
tooltip1.IsOpen = False
Cursor = Cursors.Arrow
End If
End Sub
Private Sub chartControl1_MouseLeave(ByVal sender As Object, ByVal e As MouseEventArgs)
tooltip1.IsOpen = False
End Sub
End Class
End Namespace