]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Fixed closing span position 2308/head
authorPeter <pwavg@users.noreply.github.com>
Wed, 20 Apr 2016 11:55:58 +0000 (13:55 +0200)
committerPeter <pwavg@users.noreply.github.com>
Wed, 20 Apr 2016 11:55:58 +0000 (13:55 +0200)
In the pie/doughnut legendCallback function the <span> is not closed immediately so that the text is written in the <span> instead of the <li>

src/controllers/controller.doughnut.js

index de5c041c211334ec8a6da9b7eb6c2e52c4ee77a5..d4323437533b981ecac79a9d68e2c67916fb90a7 100644 (file)
@@ -21,11 +21,11 @@ module.exports = function(Chart) {
 
                        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] + '">');
+                                       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('</span></li>');
+                                       text.push('</li>');
                                }
                        }
 
@@ -285,4 +285,4 @@ module.exports = function(Chart) {
                        }
                }
        });
-};
\ No newline at end of file
+};