Fixed the generateLegend function to create the colour block next to the text instead of around it.
var text = [];
text.push('<ul class="' + chart.id + '-legend">');
for (var i = 0; i < chart.data.datasets.length; i++) {
- text.push('<li><span style="background-color:' + chart.data.datasets[i].backgroundColor + '">');
+ text.push('<li><span style="background-color:' + chart.data.datasets[i].backgroundColor + '"></span>');
if (chart.data.datasets[i].label) {
text.push(chart.data.datasets[i].label);
}
- text.push('</span></li>');
+ text.push('</li>');
}
text.push('</ul>');
return Chart;
-};
\ No newline at end of file
+};