不支持此行为,但可以添加。您可以在Telerik的论坛here上看到有关它和回复的问题。
建议的解决方案是使用[item]
组件的kendo-chart-legend
属性。
请参阅以下示例用法:
将它放在`Kendo Chart组件内的组件模板中:
<kendo-chart-legend position="bottom" orientation="horizontal" [item]="{ visual: legendItemVisual }">
</kendo-chart-legend>
将其放在组件的代码中:
public legendItemVisual = (args: any) => {
const path = new Path({ stroke: { color: args.series.color, dashType: args.series.dashType, width: 2}})
.moveTo(0, 0).lineTo(25);
const text = new Text(args.series.name);
const layout = new Layout(new Rect([0, 0], [Number.MAX_VALUE, 0]), {
alignItems: "center",
cursor: 'pointer',
spacing: 5
});
layout.append(path, text);
layout.reflow();
return layout;
}