Вопрос

I know the default icon is "circle",now I want to change the icon shape.The total icon shape are only "circle", "square", "triangle", "cross".Can Iuse custome icon?I use these codes in the databound event,but it seems not work.

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";
 }
Это было полезно?

Решение

As far as I know,it can not be custom.You can change the type like these:

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];
  }
}
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top