add_chart_from_workbook method

add_chart_from_workbook

Retrieves a chart from the specified Excel workbook and adds it to the end of the given shape collection at the specified coordinates.

Returns

The chart that was added to the shape collection.

@staticmethod
def add_chart_from_workbook(shapes, x, y, workbook, worksheet_name, chart_index, embed_all_workbook):
    ...
ParameterTypeDescription
shapesIShapeCollectionThe shape collection to which the chart will be added.
xfloatThe X coordinate for positioning the chart.
yfloatThe Y coordinate for positioning the chart.
workbookIExcelDataWorkbookThe Excel workbook.
worksheet_namestrThe name of the worksheet that contains the chart.
chart_indexintThe zero-based index of the chart shape to insert.

This index can be obtained using the IExcelDataWorkbook.get_charts_from_worksheet method.
embed_all_workbookboolIf true, the entire workbook will be embedded in the chart;

if false, only the chart data will be embedded.

Examples

Example:

Exceptions

ExceptionDescription
RuntimeError(Proxy error(ArgumentException))Thrown when any required parameter is None, empty, or if the chart cannot be found in the workbook.

add_chart_from_workbook

Retrieves a chart from the specified Excel workbook and adds it to the end of the given shape collection at the specified coordinates.

Returns

The chart that was added to the shape collection.

@staticmethod
def add_chart_from_workbook(shapes, x, y, workbook, worksheet_name, chart_name, embed_all_workbook):
    ...
ParameterTypeDescription
shapesIShapeCollectionThe shape collection to which the chart will be added.
xfloatThe X coordinate for positioning the chart.
yfloatThe Y coordinate for positioning the chart.
workbookIExcelDataWorkbookThe Excel workbook.
worksheet_namestrThe name of the worksheet that contains the chart.
chart_namestrThe name of the chart to be added.
embed_all_workbookboolIf true, the entire workbook will be embedded in the chart;

if false, only the chart data will be embedded.

Examples

Example:

Exceptions

ExceptionDescription
RuntimeError(Proxy error(ArgumentException))Thrown when any required parameter is None, empty, or if the chart cannot be found in the workbook.

add_chart_from_workbook

Retrieves a chart from the specified Excel workbook and adds it to the end of the given shape collection at the specified coordinates.

Returns

The chart that was added to the shape collection.

@staticmethod
def add_chart_from_workbook(shapes, x, y, workbook_stream, worksheet_name, chart_name, embed_all_workbook):
    ...
ParameterTypeDescription
shapesIShapeCollectionThe shape collection to which the chart will be added.
xfloatThe X coordinate for positioning the chart.
yfloatThe Y coordinate for positioning the chart.
workbook_streamio.RawIOBaseA stream containing the workbook data.
worksheet_namestrThe name of the worksheet that contains the chart.
chart_namestrThe name of the chart to be added.
embed_all_workbookboolIf true, the entire workbook will be embedded in the chart;

if false, only the chart data will be embedded.

Examples

Example:

Exceptions

ExceptionDescription
RuntimeError(Proxy error(ArgumentException))Thrown when any required parameter is None, empty, or if the chart cannot be found in the workbook.
RuntimeError(Proxy error(InvalidOperationException))Thrown when the input data is in an unsupported format.

add_chart_from_workbook

Retrieves a chart from the specified Excel workbook and adds it to the end of the given shape collection at the specified coordinates.

Returns

The chart that was added to the shape collection.

@staticmethod
def add_chart_from_workbook(shapes, x, y, workbook_path, worksheet_name, chart_name, embed_workbook):
    ...
ParameterTypeDescription
shapesIShapeCollectionThe shape collection to which the chart will be added.
xfloatThe X coordinate for positioning the chart.
yfloatThe Y coordinate for positioning the chart.
workbook_pathstrThe file path to the workbook containing the chart.
worksheet_namestrThe name of the worksheet that contains the chart.
chart_namestrThe name of the chart to be added.
embed_workbookboolIf true, the workbook will be embedded in the chart;

if false, the chart will link to the external workbook.

Examples

Example:

Exceptions

ExceptionDescription
RuntimeError(Proxy error(ArgumentException))Thrown when any required parameter is None, empty, or if the chart cannot be found in the workbook.
RuntimeError(Proxy error(IOException))Thrown when an I/O error occurs while accessing the file.
RuntimeError(Proxy error(InvalidOperationException))Thrown when the input data is in an unsupported format.

See Also