I didn't see any option to do it from the annotation module so I looked around and there is an example in sync charts on how to draw a cross hair it goes like:
Code: Select all
chart.xAxis[0].drawCrosshair(event, point)
Code: Select all
chart.xAxis[0].drawCrosshair(NULL, chart.series[0].xData[30])
Just give an X coordinate(number) and thats it (my X axis is normally just time).
I would prefer to have an opption on annotation to just draw a cross hair like:
Code: Select all
this.chart.addAnnotation({
id: 'anno2',
labelOptions: {
// borderRadius: 5,
shape: 'circle',
DRAW_CROSSHAIR_X_AXIS: TRUE,
backgroundColor: 'rgba(252, 255, 197, 0.7)',
borderColor: '#AAA',
// padding: 10
},
labels: [{
point: { x: this.chart.series[0].xData[30], y: 0, xAxis: 0},
text: '3dsdas',
}]
});