insert_chart method

insert_chart

Creates a new chart, initializes it with sample series data and settings, and inserts it into the shape collection at the specified index.

Returns

The newly created IChart.

def insert_chart(self, type, x, y, width, height, index):
    ...
ParameterTypeDescription
typeChartTypeThe type of chart to create.
xfloatThe x-coordinate of the new chart, in points.
yfloatThe y-coordinate of the new chart, in points.
widthfloatThe width of the new chart, in points.
heightfloatThe height of the new chart, in points.
indexintThe zero-based index at which to insert the new chart in the shape collection.

insert_chart

Creates a new chart, initializes it with sample series data and settings, and inserts it into the shape collection at the specified index.

Returns

The newly created IChart.

def insert_chart(self, type, x, y, width, height, index, init_with_sample):
    ...
ParameterTypeDescription
typeChartTypeThe type of chart to create.
xfloatThe x-coordinate of the new chart, in points.
yfloatThe y-coordinate of the new chart, in points.
widthfloatThe width of the new chart, in points.
heightfloatThe height of the new chart, in points.
indexintThe zero-based index at which to insert the new chart in the shape collection.
init_with_sampleboolTrue to initialize the new chart with sample series data and settings;

false to create the chart with no series and only minimal settings, which makes creation faster.

See Also