title: Custom Legend with ChartJS v2.0
body: <p>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...</p>
  
  <pre><code>legendTemplate : '&lt;ul&gt;'
  +'&lt;% for (var i=0; i&lt;datasets.length; i++) { %&gt;'
  +'&lt;li&gt;'
  +'&lt;span style=\"background-color:&lt;%=datasets[i].lineColor%&gt;\"&gt;&lt;/span&gt;'
  +'&lt;% if (datasets[i].label) { %&gt;&lt;%= datasets[i].label %&gt;&lt;% } %&gt;'
  +'&lt;/li&gt;'
  +'&lt;% } %&gt;'
  +'&lt;/ul&gt;'
  </code></pre>
  
  <p>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?</p>
  
  <p>Thank you!</p>
  
  <p><strong>Update - Working code below</strong></p>
  
  <pre><code>legendCallback: function(chart) {
                  console.log(chart.data);
                  var text = [];
                  text.push('&lt;ul&gt;');
                  for (var i=0; i&lt;chart.data.datasets[0].data.length; i++) {
                      text.push('&lt;li&gt;');
                      text.push('&lt;span style="background-color:' + chart.data.datasets[0].backgroundColor[i] + '"&gt;' + chart.data.datasets[0].data[i] + '&lt;/span&gt;');
                      if (chart.data.labels[i]) {
                          text.push(chart.data.labels[i]);
                      }
                      text.push('&lt;/li&gt;');
                  }
                  text.push('&lt;/ul&gt;');
                  return text.join("");
              }
  </code></pre>