Custom AxisMarkerAnnotation
SciChart.js allows to create custom axis marker annotations on axes. This is done by creating AxisMarkerAnnotation and passing an image option into the constructor.
const customAxisMarkerAnnotation = new AxisMarkerAnnotation({
x1: 2,
isEditable: true,
image: htmlImageElement,
});
x1: 2,
isEditable: true,
image: htmlImageElement,
});
The full example code is below.
In this example we are using webpack url-loader to load customAxisMarkerImage and createImageAsync helper function to create htmlImageElement.
This give us a chart with just two axes and an annotation.
On the chart we can see a cloud-shaped custom axis label annotation. The annotation is draggable along the X Axis.
It is also possible to set width and height using imageWidth and imageHeight options.
const customAxisMarkerAnnotation = new AxisMarkerAnnotation({
x1: 5,
isEditable: true,
image: htmlImageElement,
imageWidth: 100,
imageHeight: 100
});
x1: 5,
isEditable: true,
image: htmlImageElement,
imageWidth: 100,
imageHeight: 100
});
See Also