TooltipModifier
Tooltips may be added to the SciChartSurface using the TooltipModifier.
Note
The TooltipModifier is specifically suited for scatter X-Y
data, although it may be used for any type of data in SciChart.
Note
Examples of the TooltipModifier usage can be found in the SciChart Android Examples Suite as well as on GitHub:
TooltipModifier Usage
The TooltipModifier allows inspecting RenderableSeries at a touch point. For convenience, the actual hit-test point is located a bit upper. It is marked with a small "X" sign. Tooltips will appear to the side of it, showing the hit-test result for all RenderableSeries at the "X" location:
For hit-testing series parts that are close to the chart boundaries, a multi-touch finger drag can be used:
TooltipModifier Features
Besides the TooltipModifier specific features, there are some common features which are shared between TooltipModifier, RolloverModifier and CursorModifier via common TooltipModifierBase class.
Common Features
Feature | Description |
---|---|
setShowTooltip(boolean showTooltip) | Allows to hide or show modifier's Tooltips. |
setUseInterpolation(boolean useInterpolation) | Allows to show interpolated values between data points. It is a true by default. If false - modifier's Tooltips will report the info about closest data points. |
setSourceMode(SourceMode sourceMode) | Allows to specify which IRenderableSeries are to be inspected by a modifier, e.g. Visible, Selected, etc. Other will be ignored by the modifier. Expects a member of the SourceMode enumeration. |
Specific Features
Feature | Description |
---|---|
setOffset(float offset) | Specifies how far the hit-test point is from the actual touch point. This value will be used for either X or Y coordinate, or both, depending on markerPlacement . |
setCustomPointOffset(PointF customPointOffset) | Specifies how far the hit-test point is from the actual touch point. As opposed to offset , both X and Y coordinate will always be applied. |
setMarkerPlacement(Placement markerPlacement) | Allows to specify the position of the hit-test point relative to the touch point, e.g. Left, Top, etc... Expects a member of the Placement enumeration. |
setTooltipPosition(TooltipPosition tooltipPosition) | Allows to specify the position of modifier's Tooltips relative to the hit-test point, e.g. TopLeft, BottomRight, etc.... Expects a member of the TooltipPosition enumeration. |
getTooltipPointMarkerPaint() | Returns the Paint object that is responsible for the "X" marker drawing (marking the hit-test point). Can be used to change style and color properties of the marker. |
Adding a TooltipModifier to a Chart
Any Chart Modifier can be added to a SciChartSurface via the chartModifiers property and TooltipModifier is no difference:
// Assume a surface has been created and configured somewhere
surface.getChartModifiers().add(new TooltipModifier());
Note
To learn more about features available, please visit the Chart Modifier APIs article.