Fixed the generateLegend function

Fixed the generateLegend function to create the colour block next to the text instead of around it.
This commit is contained in:
dibsyjr1 2016-04-13 16:03:08 +01:00
parent 4b96572ac0
commit 5aa16a67c1

View File

@ -86,11 +86,11 @@ module.exports = function() {
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>');
@ -101,4 +101,4 @@ module.exports = function() {
return Chart;
};
};