]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Minor legend fix when going to next line
authorEvert Timberg <evert.timberg+github@gmail.com>
Thu, 5 May 2016 01:06:19 +0000 (21:06 -0400)
committerEvert Timberg <evert.timberg+github@gmail.com>
Thu, 5 May 2016 01:06:19 +0000 (21:06 -0400)
src/core/core.legend.js

index a7ef76c689b3b068cb257faee85f7a51ddafea71..b8ae19eb145d899585a339a0b466abfb2b1a7f6d 100644 (file)
@@ -273,9 +273,9 @@ module.exports = function(Chart) {
                                                        y = cursor.y;
 
                                                if (x + width >= legendWidth) {
-                                                       cursor.y += fontSize + (labelOpts.padding);
+                                                       y = cursor.y += fontSize + (labelOpts.padding);
                                                        cursor.line++;
-                                                       cursor.x = this.left + ((legendWidth - lineWidths[cursor.line]) / 2);
+                                                       x = cursor.x = this.left + ((legendWidth - lineWidths[cursor.line]) / 2);
                                                }
 
                                                // Set the ctx for the box