Skip to content
Open
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
5 changes: 2 additions & 3 deletions src/pptx/shapes/shapetree.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
from pptx.util import Emu, lazyproperty

if TYPE_CHECKING:
from pptx.chart.chart import Chart
from pptx.chart.data import ChartData
from pptx.enum.chart import XL_CHART_TYPE
from pptx.enum.shapes import MSO_CONNECTOR_TYPE, MSO_SHAPE
Expand Down Expand Up @@ -241,7 +240,7 @@ def add_chart(
cx: Length,
cy: Length,
chart_data: ChartData,
) -> Chart:
) -> GraphicFrame:
"""Add a new chart of `chart_type` to the slide.

The chart is positioned at (`x`, `y`), has size (`cx`, `cy`), and depicts `chart_data`.
Expand All @@ -255,7 +254,7 @@ def add_chart(
rId = self.part.add_chart_part(chart_type, chart_data)
graphicFrame = self._add_chart_graphicFrame(rId, x, y, cx, cy)
self._recalculate_extents()
return cast("Chart", self._shape_factory(graphicFrame))
return cast(GraphicFrame, self._shape_factory(graphicFrame))

def add_connector(
self,
Expand Down