0

I have the following implementation, it works and functional. However I would like to assign fname attribute as a legend, not series attribute.

I believe that I need to work on the following line of code, but I could not able to figure out yet.

var label = new kendo.drawing.Text(e.series.name, [0, 0], {
  fill: {
     color: "black"
  }
});

http://jsfiddle.net/1ost124j/1/

casillas
  • 16,351
  • 19
  • 115
  • 215
  • something like `e.series.data[1].fname` ? Not totally sure though. Works for first 3 only http://jsfiddle.net/dhirajbodicherla/1ost124j/2/ ! Again :D – Dhiraj Jun 05 '15 at 04:48

1 Answers1

3

Something like e.series.data[1].fname should do it.


More accurately (based on your suggestion) the below is the fully working code

for (var i = 0; i < e.series.data.length; i++) {
  if (e.series.data[i].valueColor != "" && e.series.data[i].fname != "") {
    color = e.series.data[i].valueColor,
      legendName = e.series.data[i].fname
  }
}
var label = new kendo.drawing.Text(legendName, [0, 0], {
  fill: {
    color: "black"
  }
});

With a demo http://jsfiddle.net/1ost124j/3/

Dhiraj
  • 33,140
  • 10
  • 61
  • 78