mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
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:
parent
4b96572ac0
commit
5aa16a67c1
@ -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;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user