From 8200437bbc1110ddc0819bbf9762d28fe8629da3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Szumi=C5=84ski?= Date: Thu, 23 Nov 2023 14:21:48 +0100 Subject: [PATCH 1/2] Added omitBackground: true. --- lib/export.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/export.js b/lib/export.js index 309ae8c1..b2f7e3ad 100644 --- a/lib/export.js +++ b/lib/export.js @@ -59,7 +59,8 @@ const createImage = async (page, type, encoding, clip) => page.screenshot({ type, encoding, - clip + clip, + omitBackground: true }), new Promise((resolve, reject) => setTimeout(() => reject(new Error('Rasterization timeout')), 1500) From a88354e45adc3d820405c17af484a1d596244166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Szumi=C5=84ski?= Date: Thu, 23 Nov 2023 14:40:29 +0100 Subject: [PATCH 2/2] Added a clarifying comment. --- lib/export.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/export.js b/lib/export.js index b2f7e3ad..c1fd3889 100644 --- a/lib/export.js +++ b/lib/export.js @@ -60,6 +60,10 @@ const createImage = async (page, type, encoding, clip) => type, encoding, clip, + + // #447 - always render on a transparent page + // this will not affect users who do not explicitly set + // chart.backgroundColor to a color with opacity lower than 1 omitBackground: true }), new Promise((resolve, reject) =>