From f496a6fd8f11edaa8b1033572ab70afebc329784 Mon Sep 17 00:00:00 2001 From: Boyi C Date: Fri, 15 Dec 2017 21:17:31 +0800 Subject: [PATCH] Bug fix for infinite loop fix chartjs/Chart.js#5047 --- src/core/core.layoutService.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/core.layoutService.js b/src/core/core.layoutService.js index df28f974eb1..61db142fa92 100644 --- a/src/core/core.layoutService.js +++ b/src/core/core.layoutService.js @@ -172,6 +172,8 @@ module.exports = function(Chart) { // Step 1 var chartWidth = width - leftPadding - rightPadding; var chartHeight = height - topPadding - bottomPadding; + if (chartWidth < 0) chartWidth = 0; + if (chartHeight < 0) chartHeight = 0; var chartAreaWidth = chartWidth / 2; // min 50% var chartAreaHeight = chartHeight / 2; // min 50%