Annotation types
Graphy supports seven types of annotations.Sticker
Adds an emoji sticker to a specific data point on the chart.The sticker to display. Available options:
'rocket', 'clapping-hands', 'thumbs-up', 'thumbs-down',
'grinning-face'.Optional categorical value to pin the annotation to. Used to remap the annotation if the dataset changes.
Tooltip
Displays a custom tooltip with rich text content at a specific data point.Highlight
Highlights a data point, entire series or all data points at a specific x-value.What to highlight: -
'data-point' - Highlight a single data point - 'series' - Highlight an entire series -
'x-value' - Highlight all data points at a specific x-valueText
Adds a text box with rich text content positioned relative to the plot area.Horizontal position relative to the plot area (0 to 1). Represents the midpoint of the text box.
Vertical position relative to the plot area (0 to 1). Represents the midpoint of the text box.
Arrow
Draws an arrow between two points on the chart with customizable styling.Difference arrow
Shows the difference between two data points with an automatic label displaying the calculated difference.What to display: -
'absolute-difference' - Show the numeric difference - 'relative-difference' - Show the
percentage change - 'proportion' - Show the ratio between valuesPosition of the label along the arrow (0 to 1): -
0 - Label at the start (default) - 0.5 - Label in the middle -
1 - Label at the endShape
Adds a rectangular shape to the chart, either below or above the plot area.Canvas colors
Canvas colors are the default options displayed in the color picker for annotations that allow the user to customize strokes, fills and text colors. Each canvas color is defined as an object with the following properties:Color persistence across themes
Theid property is important for maintaining color consistency when switching between themes. When a user applies a canvas color to an annotation (such as text color or arrow stroke), the color’s id is stored rather than the hex value itself.
When the theme changes:
- Matching ID found: If the new theme contains a canvas color with the same
id, the annotation automatically uses the color value from the new theme. This allows colors to adapt appropriately—for example, a “default” color might be black in a light theme but white in a dark theme. - No matching ID: If the new theme does not contain a canvas color with the same
id, the annotation falls back to the first canvas color in the new theme’scanvasColorsarray.
Default annotation colors
When users create new annotations, Graphy applies default colors automatically. You can configure these defaults via thedefaultAnnotationColorIds property in your theme, which references the id values from your canvasColors array.
See GraphThemeAnnotationColorIds for the available properties.
Fallback behavior
If a default annotation color is not configured or references an invalidid, Graphy automatically falls back to the first canvas color in the canvasColors array. This ensures annotations always render with a valid color, even if the configuration is incomplete.
