From 2ac1af3f265d7b6c863d9b2bb86ba643819cc969 Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Tue, 14 May 2024 03:11:59 -0700 Subject: [PATCH] [BugFix] Make `paper_bgcolor` transparent in PyWry backend (#6385) * make paper_bgcolor transparent in PyWry backend * black --------- Co-authored-by: Henrique Joaquim --- .../charting/openbb_charting/core/backend.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openbb_platform/obbject_extensions/charting/openbb_charting/core/backend.py b/openbb_platform/obbject_extensions/charting/openbb_charting/core/backend.py index 79d4c56e18b5..fb2503afe864 100644 --- a/openbb_platform/obbject_extensions/charting/openbb_charting/core/backend.py +++ b/openbb_platform/obbject_extensions/charting/openbb_charting/core/backend.py @@ -198,6 +198,12 @@ def send_figure( self.check_backend() # pylint: disable=C0415 + paper_bg = ( + "rgba(0,0,0,0)" + if self.charting_settings.chart_style == "dark" + else "rgba(255,255,255,0)" + ) + title = "Interactive Chart" fig.layout.title.text = re.sub( @@ -210,9 +216,8 @@ def send_figure( export_image = Path(export_image).resolve() json_data = json.loads(fig.to_json()) - json_data.update(self.get_json_update(command_location)) - + json_data["layout"]["paper_bgcolor"] = paper_bg outgoing = dict( html=self.get_plotly_html(), json_data=json_data,