Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion sdk/python/packages/flet-core/src/flet_core/matplotlib_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def __init__(
#
isolated: bool = False,
original_size: bool = False,
transparent: bool = False,
):

Container.__init__(
Expand Down Expand Up @@ -120,6 +121,7 @@ def __init__(
self.figure = figure
self.isolated = isolated
self.original_size = original_size
self.transparent = transparent

def _is_isolated(self):
return self.__isolated
Expand All @@ -133,7 +135,7 @@ def _before_build_command(self):
super()._before_build_command()
if self.__figure is not None:
s = io.StringIO()
self.__figure.savefig(s, format="svg")
self.__figure.savefig(s, format="svg", transparent=self.__transparent)
svg = s.getvalue()

if not self.__original_size:
Expand Down Expand Up @@ -178,3 +180,12 @@ def maintain_aspect_ratio(self) -> bool:
@maintain_aspect_ratio.setter
def maintain_aspect_ratio(self, value: bool):
self.__maintain_aspect_ratio = value

# transparent
@property
def transparent(self) -> bool:
return self.__transparent

@transparent.setter
def transparent(self, value: bool):
self.__transparent = value