Author Topic: Chart With Logging - Mouse Over  (Read 1339 times)

DavidSr

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Chart With Logging - Mouse Over
« on: July 10, 2019, 06:09:42 PM »
399y Beta 33 Chart with logging.

I have a chart logging two values that is configured to use a line. The values are logged in 15 minute intervals.


When I rest the mouse over the Top line the value at the cursor is displayed. But it does not display a value when resting the mouse anywhere on the bottom line.


David

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Chart With Logging - Mouse Over
« Reply #1 on: July 11, 2019, 01:00:41 AM »
It seems that only series(0) ToolTip is set. All other series ToolTip property will have to be set as well.

DavidSr

  • Full Member
  • ***
  • Posts: 170
    • View Profile
Re: Chart With Logging - Mouse Over
« Reply #2 on: July 11, 2019, 09:39:26 AM »
It seems that only series(0) ToolTip is set. All other series ToolTip property will have to be set as well.
Hi Godra,, could you expand on that? not sure what I need to resolve it, looked at mainform.vb but don't see any code for it. Am I supposed to be looking for something starting with something like this?
Code: [Select]
// Set ToolTips for Data Point Series ....

chart1.Series[0].ToolTip =

David

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Chart With Logging - Mouse Over
« Reply #3 on: July 11, 2019, 09:27:06 PM »
David, my suggestion was more for Archie than you, but here is a temporary fix you could use (inside the Region "Subscribing and PLC data receiving" of the ChartWithLogging control):

Code: [Select]
    Private seriesToolTipCreated As Boolean
    Private Sub PolledDataReturned(ByVal sender As Object, ByVal e As SubscriptionHandlerEventArgs)
        If Not seriesToolTipCreated AndAlso MyBase.Chart1.Series.Count > 0 Then
            For i = 0 To m_PLCAddressValueItems.Count - 1
                MyBase.Chart1.Series(i).ToolTip = "#AXISLABEL, #VALY"
            Next
            seriesToolTipCreated = True
        End If

        If e.PLCComEventArgs.ErrorId = 0 Then
            Try
                If String.IsNullOrEmpty(e.SubscriptionDetail.PropertyNameToSet) Or String.Compare(e.SubscriptionDetail.PropertyNameToSet, e.PLCComEventArgs.PlcAddress, True) = 0 Then
                    PolledDataReturnedValue(sender, e.PLCComEventArgs)
                ElseIf e.SubscriptionDetail.PropertyNameToSet = "Value" Then
                    PolledDataReturnedValue(sender, e.PLCComEventArgs)
                Else
                    Try
                        '* Write the value to the property that came from the end of the PLCAddress... property name
                        Me.GetType().GetProperty(e.SubscriptionDetail.PropertyNameToSet).
                                    SetValue(Me, Utilities.DynamicConverter(e.PLCComEventArgs.Values(0),
                                                Me.GetType().GetProperty(e.SubscriptionDetail.PropertyNameToSet).PropertyType), Nothing)
                    Catch ex As Exception
                        'OnDisplayError("INVALID VALUE RETURNED!" & a.PLCComEventArgs.Values(0))
                    End Try
                End If
            Catch ex As Exception
                DisplayError("INVALID VALUE!" & ex.Message)
            End Try
        Else
            DisplayError("Com Error " & e.PLCComEventArgs.ErrorId & "." & e.PLCComEventArgs.ErrorMessage)
        End If
    End Sub
« Last Edit: July 11, 2019, 09:43:54 PM by Godra »