是否有一种方法可以将不同的标记类型(圆,方形,三角形等(分配给同一系列的特定数据点?(我正在使用散点图(
我知道可以用颜色完成:为每个数据点示例分配特定颜色
,您也可以更改整个系列的类型:示例
,但我需要在同一条线上至少有2种不同类型(圆形和三角形(
欢迎任何建议,谢谢
您可以使用系列标记的 Visual Property 绘制所需的形状,例如:
series: [{
type: "line",
markers: {
visual: function (e) {
var origin = e.rect.origin;
var center = e.rect.center();
var bottomRight = e.rect.bottomRight();
if (e.value < 2){
return e.createVisual();
} else {
var path = new kendo.drawing.Path({
stroke: {color: e.options.border.color, width: 2},
fill: { color: "white" }
})
.moveTo(origin.x, bottomRight.y)
.lineTo(bottomRight.x, bottomRight.y)
.lineTo(center.x, origin.y)
.close();
return path;
}
}
}