From 7e3331fe19cda4698a6ef5a224f81b6524b4bbd2 Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Thu, 9 May 2024 11:40:43 -0700 Subject: [PATCH 1/2] make paper_bgcolor transparent in PyWry backend --- .../charting/openbb_charting/core/backend.py | 5 +++-- 1 file changed, 3 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..36f1284de558 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,8 @@ 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 +212,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, From ea36be7a71bbfc52f82f2bf2b7af31cb547c1bca Mon Sep 17 00:00:00 2001 From: Danglewood <85772166+deeleeramone@users.noreply.github.com> Date: Thu, 9 May 2024 11:55:41 -0700 Subject: [PATCH 2/2] black --- .../charting/openbb_charting/core/backend.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 36f1284de558..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,7 +198,11 @@ 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)" + paper_bg = ( + "rgba(0,0,0,0)" + if self.charting_settings.chart_style == "dark" + else "rgba(255,255,255,0)" + ) title = "Interactive Chart"