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,