chart.addAnnotation({
x: clickX,
y: clickY,
allowDragX: true,
allowDragY: true,
anchorX: 'left',
anchorY: 'top',
title: title,
shape: {
type: shape,
params: {
r: shape == 'circle' ? 1 : 0,
d: shape == 'path' ? ['M', 0, 0, 'L', 1, 1] : null,
dd: shape == 'db-path' ? ['M', 0, 0, 'L', 1, 1] : null,
x: x,
y: y,
width: width,
height: height,
fill: fill,
stroke: stroke,
strokeWidth: strokeWidth
}
}
});
你可以为它设置合适的路径,像这样:
d: ['M', 10, 10, 'L', 20, 10, 'M', 10, 20, 'L', 20, 20]
演示:http://jsfiddle.net/N6GR9/14/