我看到其他答案,但它是三角形的。我真正需要的是做一个如下图所示的圆形图标:
我尝试通过Dojo example在此Circle Geometry API中自定义“kendo.geometry.Rect”。但我需要帮助理解我应该做的事情。
答案 0 :(得分:2)
You Circle Geometry仅定义中心和半径。然后,您需要使用 drawing.Circle :
visual: function (e) {
// get color of current marker and label
var color = e.options.markers.background;
var labelColor = e.options.labels.color;
var rect = new kendo.geometry.Rect([0, 0], [100, 50]);
var layout = new kendo.drawing.Layout(rect, {
spacing: 5,
alignItems: "center"
});
// create a circle geometry centered at x=10, y=5, with a radius of 5
var CircGeometry = new kendo.geometry.Circle([10, 5], 5);
// draw the circle using the geometry and set the color (could have no stroke)
var MarkerCircle = new kendo.drawing.Circle(CircGeometry, {
stroke: { color: color, width: 1 },
fill: { color: color }
});
//Create the text label
var label = new kendo.drawing.Text(e.series.name, [0, 0], {
fill: {
color: labelColor
}
});
//Add circle and label to layout object
layout.append(MarkerCircle, label);
layout.reflow()
return layout;
}