From dee5ca6f50a8c5a98224686666d9a67f1b23f5ae Mon Sep 17 00:00:00 2001 From: Pavel Torbeev Date: Sun, 27 Aug 2023 09:17:50 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D1=84=D0=B8=D0=BA=D1=81=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B3=D1=80=D0=B0=D1=84=D0=B8=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/deck/document/media/generateFinancialChart.ts | 5 ++++- src/pages/deck/document/media/generateGrowChart.ts | 5 ++++- src/pages/deck/document/media/generateMarketChart.ts | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/pages/deck/document/media/generateFinancialChart.ts b/src/pages/deck/document/media/generateFinancialChart.ts index 5d7f246..e1104d0 100644 --- a/src/pages/deck/document/media/generateFinancialChart.ts +++ b/src/pages/deck/document/media/generateFinancialChart.ts @@ -20,7 +20,10 @@ export const generateFinancialChart = (rootId: string, [cac, ltv]: [number, numb aspectRatio: 2, animation: { onComplete: function () { - callback(chart.toBase64Image()); + setTimeout(() => { + const image = chart?.toBase64Image() || 'data:image/png;base64,i'; + callback(image); + }, 1000); }, }, }, diff --git a/src/pages/deck/document/media/generateGrowChart.ts b/src/pages/deck/document/media/generateGrowChart.ts index eed1f5d..de8ac35 100644 --- a/src/pages/deck/document/media/generateGrowChart.ts +++ b/src/pages/deck/document/media/generateGrowChart.ts @@ -24,7 +24,10 @@ export const generateGrowChart = (rootId: string, [company_value, future_value, aspectRatio: 2, animation: { onComplete: function () { - callback(chart.toBase64Image()); + setTimeout(() => { + const image = chart?.toBase64Image() || 'data:image/png;base64,i'; + callback(image); + }, 1000); }, }, }, diff --git a/src/pages/deck/document/media/generateMarketChart.ts b/src/pages/deck/document/media/generateMarketChart.ts index 7c643c7..13f3894 100644 --- a/src/pages/deck/document/media/generateMarketChart.ts +++ b/src/pages/deck/document/media/generateMarketChart.ts @@ -20,7 +20,10 @@ export const generateMarketChart = (rootId: string, [tam, sam, som]: [number, nu aspectRatio: 2, animation: { onComplete: function () { - callback(chart.toBase64Image()); + setTimeout(() => { + const image = chart?.toBase64Image() || 'data:image/png;base64,i'; + callback(image); + }, 1000); }, }, },