Print Page | Close Window

Display Y Axis Point Value On MouseOver

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Chart Control
Forum Description: Topics Related to Codejock Chart Control
URL: http://forum.codejock.com/forum_posts.asp?TID=20399
Printed Date: 19 April 2024 at 3:11am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Display Y Axis Point Value On MouseOver
Posted By: SeatTrax
Subject: Display Y Axis Point Value On MouseOver
Date Posted: 06 December 2012 at 6:13pm
In our ChartSplineSeriesStyle charts, we don't like the look of the labels on the points, and always set Style.Label.Visible = False.

Now we have a customer that has asked if we can display the Y Axis point value when they mouse over the point.

I looked through the development forums, and didn't find any mention of a mouse over method, and the only thing I could find in the codejock sample chart programs was the following sub routine in ChartSample.vbp, but it writes the point value to the immediate window, and we want it to display above the point, when the point is mouse over'd.

Private Sub ChartControl_MouseMove(Button As Integer, Shift As Integer, x As Long, y As Long)
    Dim Element As ChartElement
    Set Element = ChartControl.HitTest(x, y)
   
    If TypeOf Element Is XtremeChartControl.ChartSeriesPoint Then
        Dim Point As ChartSeriesPoint
        On Error Resume Next
        Set Point = Element
   
        If (Not Point Is Nothing) Then
            Debug.Print "Point " & Point.Value(0)
        End If
    End If
   
End Sub

Is is possible to add this functionality w/ the existing Chart Control?



Replies:
Posted By: SeatTrax
Date Posted: 07 December 2012 at 10:38am
Figured out the answer to my own dilemma Smile

Wish the CodeJock example code was a bit more detailed tho!

Private Sub ChartControl_MouseMove(Button As Integer, Shift As Integer, x As Long, y As Long)
    Dim Element As ChartElement
    Set Element = ChartControl.HitTest(x, y)
  
    If TypeOf Element Is XtremeChartControl.ChartSeriesPoint Then
        Dim Point As ChartSeriesPoint
        On Error Resume Next
        Set Point = Element
  
        If (Not Point Is Nothing) Then
            ChartControl.ToolTipText = Point.Value(0)

        End If
    End If
  
End Sub




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net