如何更改Kendo UI折线图中的系列图标形状?我可以使用自定义图标吗?

时间:2014-04-28 13:22:38

标签: kendo-ui kendo-asp.net-mvc kendo-dataviz kendo-chart

我知道默认图标是"圈",现在我想更改图标形状。总图标形状仅为"圆","方" ,"三角形","交叉"。可以使用自定义图标吗?我在数据绑定事件中使用这些代码,但似乎不起作用。

var colorArr = new Array("#FF0000", "#FF8C00", "#006400", "#40E0D0", "#800080");
var iconShapeArr = newArray("circle", "square", "triangle", "cross");
function onDataBound(e) {
 var chart = e.sender;
 var series = chart.options.series;
 for(var index = 0; index <= series.length - 1; index++) {
     chart.options.series[index].color = colorArr[index];
     chart.options.series[index].markers.background = colorArr[index];
    // chart.options.series[index].notes.icon.shape = "square";
 }

1 个答案:

答案 0 :(得分:1)

据我所知,它无法自定义。您可以更改类似的类型:

function onDataBound(e) {
var colorArr = ["#FF0000", "#FF8C00", "#006400", "#40E0D0", "#800080"];
var iconShapeArr = ["triangle", "square", "triangle", "cross"];
var chart = e.sender;
var series = chart.options.series;
for(var index = 0; index <= series.length - 1; index++) {
   chart.options.series[index].color = colorArr[index];
   chart.options.series[index].markers.background = colorArr[index];
   chart.options.series[index].markers.type = iconShapeArr[index];
  }
}