DIAdem Help

Object: ToolTipPieChartContext

  • Updated2024-09-12
  • 2 minute(s) read

Object: ToolTipPieChartContext

The ToolTipPieChartContext object provides information on a pie chart in DIAdem REPORT when DIAdem calls the event assigned to the OnPieChart for ToolTipEvents property. DIAdem calls this event if you press the shift key and move the mouse over a REPORT object.

Note  To test the example script, you must first save the second script and register it as a user command in the dialog box that opens when you select Settings»Extensions»User Commands.

The following example creates a pie chart and assignees the user command MyToolTipEvent to the property OnPieChart for ToolTipEvents:

Dim oMyPieChart, oMyCurvePieChart, oMyPos, oMySliceLabel
Call Data.Root.Clear()
Call DataFileLoad(DataReadPath & "Example.tdm","TDM","")
Report.NewLayout
Set oMyPieChart = Report.ActiveSheet.Objects.Add(eReportObjectPieChart, "MyPieChart")
Set oMyPos = oMyPieChart.Position.ByCoordinate
oMyPos.X1 = 20
oMyPos.X2 = 80
oMyPos.Y1 = 20
oMyPos.Y2 = 80
Set oMyCurvePieChart = oMyPieChart.CurvePieChart
oMyCurvePieChart.Channel.Reference = "[5]/[4]" 
Set oMySliceLabel = oMyCurvePieChart.SliceLabel
oMySliceLabel.CategoryVisible = True
oMySliceLabel.Channel.Reference = "[5]/[1]" 
oMySliceLabel.CategoryMode = eCategoryModeChannel
'This event will be raised if the mouse is moved AND the shift key pressed 
Report.Events.ToolTip.OnPieChart = "MyToolTipEvent"
Call Report.Refresh()

If you press the shift key and move the mouse over the pie chart, the example displays the mouse position and the name and the type of the subobject over which you idle the mouse. The user command receives two parameters. The first parameter corresponds with the ToolTipPieChartContext object and provides the information about the spider axis system in DIAdem REPORT when you press the shift key and move the mouse over the spider axis system. The second parameter is a text and corresponds with the tooltip:

Sub MyToolTipEvent(Context,ToolTipText)
  Dim oSubObject
  Set oSubObject = Context.SubObject
  ToolTipText = "Sheet: " & Context.Sheet.Name & VBCrLf & "-Sub object-" & VBCrLf & "Name: " &  oSubObject.Name & VBCrLf & "Index: " & oSubObject.Index & VBCrLf & "Type: " & GetConstNameForREPORTSubObj(oSubObject, oSubObject.Type)
  ToolTipText = ToolTipText & VBCrLf & "X position: " & Context.Position.X & VBCrLf & "Y position: " & Context.Position.Y 
End Sub

Properties

PieChart | Position | Sheet | SubObject