有没有办法将不同的标记类型(圆形、方形、三 Angular 形等)分配给同一系列上的特定数据点? (我使用的是散点图)
我知道可以用颜色来完成: Assigning specific color to each data point example
您还可以更改整个系列的类型:example
但我需要在同一行上至少有两种不同类型(圆形和三 Angular 形)
欢迎任何建议,谢谢
最佳答案
您可以使用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;
}
}
}
<强> DEMO
关于javascript - 剑道图表更改同一系列上的各个标记类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44375574/