Skip to content

Legend not correct displayed for polar Area chart. #3059

@luqiss

Description

@luqiss

in Chart.bundle.js in line 7215-7230 is little bug which effect by not correct display of legend for chart "Polar Area".

Now is:

legendCallback: function(chart) { var text = []; text.push('<ul class="' + chart.id + '-legend">'); if (chart.data.datasets.length) { for (var i = 0; i < chart.data.datasets[0].data.length; ++i) { text.push('<li><span style="background-color:' + chart.data.datasets[0].backgroundColor[i] + '">'); if (chart.data.labels[i]) { text.push(chart.data.labels[i]); } text.push('</li>'); } } text.push('</span></ul>'); return text.join(""); }

Should be:

legendCallback: function(chart) { var text = []; text.push('<ul class="' + chart.id + '-legend">'); if (chart.data.datasets.length) { for (var i = 0; i < chart.data.datasets[0].data.length; ++i) { text.push('<li><span style="background-color:' + chart.data.datasets[0].backgroundColor[i] + '"></span>'); if (chart.data.labels[i]) { text.push(chart.data.labels[i]); } text.push('</li>'); } } text.push('</ul>'); return text.join(""); }

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions