]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
ensure that fullwidth boxes are at very top / bottom
authoretimberg <evert.timberg@gmail.com>
Sun, 22 Nov 2015 03:10:39 +0000 (22:10 -0500)
committeretimberg <evert.timberg@gmail.com>
Sun, 22 Nov 2015 03:10:39 +0000 (22:10 -0500)
src/core/core.layoutService.js

index fed4d0b9b3bf12ae6d42f8247e7ee94d3ee19286..51e773fbad77002ca4806aa6e960bee5e9077fcd 100644 (file)
                                return box.options.position == "chartArea";
                        });
 
+                       function fullWidthSorter(a, b) {
+
+                       }
+
+                       // Ensure that full width boxes are at the very top / bottom
+                       topBoxes.sort(function(a, b) {
+                               return (b.options.fullWidth ? 1 : 0) - (a.options.fullWidth ? 1 : 0);
+                       });
+                       bottomBoxes.sort(function(a, b) {
+                               return (a.options.fullWidth ? 1 : 0) - (b.options.fullWidth ? 1 : 0);
+                       });
+
                        // Essentially we now have any number of boxes on each of the 4 sides.
                        // Our canvas looks like the following.
                        // The areas L1 and L2 are the left axes. R1 is the right axis, T1 is the top axis and