SciChart Android 2D Charts API > ChartModifier API > Cursors and Tooltips > Tooltip Modifier
Tooltip Modifier

Tooltips may be added to the SciChartSurface using the TooltipModifier:

TooltipModifier Usage

The TooltipModifier allows inspecting RenderableSeries at a touch position. 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

To learn more about the inherited features from TooltipModifierBase and tooltips customization, please refer to the Common Features and Tooltip Customization article. The features from the table below are disctinctive to the TooltipModifier:

Feature Description
getOffset()setOffset() 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.
getCustomPointOffset()setCustomPointOffset() 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.
getMarkerPlacement()setMarkerPlacement() Allows to specify the position of the hit-test point relative to the touch point, e.g. LeftTopBottomRight. Expects a member of the Placement enumeration.
getTooltipPosition()setTooltipPosition() Allows to specify the position of modifier's Toolips relative to the hit-test point, e.g. TopLeftBottomRight. 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

A ChartModifier can be added to a ChartModifiersCollection of a SciChartSurface via the getChartModifiers()setChartModifiers() methods. This can be done using the code below:

Copy Code
// Assume the surface has been created and configured earlier
ISciChartSurface surface;

 // Create a TooltipModifier
TooltipModifier tooltipModifier = new TooltipModifier();

 // Add the modifier to the surface

Also a TooltipModifier can be created using Chart Builders. To learn more about features available, Please refer to the Common ChartModifiers Features article.

See Also