Customizing VerticalSliceModifier Tooltip Containers
tip
Background reading: If you haven't already, read the article The VerticalSliceModifier Type which will show you how to setup a VerticalSliceModifier📘 with default options for tooltips.
This article goes into further detail on customising the tooltip items (formatting, text content)
Basic Customization of VerticalSliceModifier Tooltips via properties
Basic customisation of the VerticalSliceModifier📘 appearance can be made through the following properties.
- The vertical line thickness, dash and stroke color can be changed with the VerticalSliceModifier.rolloverLineStroke📘, VerticalSliceModifier.rolloverLineStrokeThickness📘 and VerticalSliceModifier.rolloverLineStrokeDashArray📘 properties.
- The line selection color can be set via the VerticalSliceModifier.lineSelectionColor📘 property.
- The tooltip can be turned on/off (to have a simple cursor) with the VerticalSliceModifier.showTooltip📘 property.
- The tooltip background and text color can be changed with tooltipColor📘 and tooltipTextColor📘 properties, found on RenderableSeries.rolloverModifierProps📘 on a per-series basis.
- Axis labels can be turned on/off via the VerticalSliceModifier.verticalLine.showLabel📘 property, (where VerticalSliceModifier.verticalLine📘 is simply a LineAnnotation📘).
- Axis Label backgrounds and text color can be changed with the properties found on VerticalSliceModifier.verticalLine📘, such as axisLabelStroke📘, axisLabelFill📘.
Deep Customization of VerticalSliceModifier Tooltips via SVG Templates
Deeper customisation of the tooltip appearance can be achieved via the tooltipSvgTemplate📘 property.
This defines the actual SVG used to host the tooltip container. This property expects a function in the following format (see TCursorTooltipSvgTemplate📘):
- cursotTooltipSvgTemplate function signature
tooltipSvgTemplate: (
seriesInfos: SeriesInfo[],
svgAnnotation: CursorTooltipSvgAnnotation
) => string
The input/output parameters are:
- Input: an array of SeriesInfo