charton API / @chart-on/core / index / createStickerTool
Function: createStickerTool()
createStickerTool(
options):DrawingToolDef
Defined in: packages/core/src/drawing/icon-tools.ts:85
The sticker drawing tool: an image from the app centred on its point, fitted into a square of fontSize css px at angle degrees clockwise, so it reads the same at any zoom. Like createImageTool, a drawing keeps only the app's reference to its image (its text), which options.load turns into an image; the chart fetches nothing and saved drawings carry no image bytes. Images are cached per reference for the life of the tool. While selected, a corner handle sets the size and a handle above it the angle. Not one of the built-in tools: register it to offer it.
Parameters
options
Returns
Example
ts
chart.drawings.register(createStickerTool({ load: (ref) => fetch(ref).then((r) => r.blob()) }));
chart.drawings.add({ type: 'sticker', pane: 0, points: [point], style: { fontSize: 96 }, text: '/stickers/rocket.png' });