FVANCOP / ChartNew.js

MIT License
420 stars 142 forks source link

Get Color From Other > Data > Color #342

Closed ulysnep closed 9 years ago

ulysnep commented 9 years ago

Hi again!

I'm trying to get the variable "color" from Other which is in an array and append to annotateLabel and I can't seem to reference it correctly. I've created a custom div for annotateLabel and I'm trying to call "color" within it.

 annotateLabel : "<%='<div id=\"tooltip\"><div class=\"tooltip_circle' + data.color + '\"></div>&nbsp;&nbsp;' + v1 + '&nbsp;&nbsp;&nbsp;<strong>' + v6 + '%</strong>&nbsp;&nbsp;&nbsp;</div>'%>", 
FVANCOP commented 9 years ago

For Pie/Doughnut charts, use data[i].color; For Line/Bar charts, use data.datasets[i].fillColor

annotateLabel : "<%='<div id=\"tooltip\"><div class=\"tooltip_circle'\">

   Color=' + data[i].color+' ' + v1 + '   ' + v6 + '%   
'%>",

Regards, François

ulysnep commented 9 years ago

Excellent, works great! Thank you!

Cheers, Aaron