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); }, }, },