I'm trying to create a custom legend template in ChartJS v2.0. In v1* of ChartJS I simply added a property to the new Chart constructor such as...
legendTemplate : '' +'' +'- ' +'\">' +'' +'
' +'' +'
'
I can't seem to find any documentation in v2.0 for this option. Is it even available anymore? Can anyone show an example of how to accomplish this?
Thank you!
Update - Working code below
legendCallback: function(chart) { console.log(chart.data); var text = []; text.push(''); for (var i=0; i'); text.push('' + chart.data.datasets[0].data[i] + ''); if (chart.data.labels[i]) { text.push(chart.data.labels[i]); } text.push(''); } text.push('
'); return text.join(""); }