has_default_format method

has_default_format(data_point_index)

Gets a flag indicating whether the data point at the specified index has default format.

def has_default_format(self, data_point_index: int):
    ...
ParameterTypeDescription
data_point_indexint

Examples

Shows how to copy data point format.

doc = aw.Document(file_name=MY_DIR + 'DataPoint format.docx')
# Get the chart and series to update format.
shape = doc.get_child(aw.NodeType.SHAPE, 0, True).as_shape()
series = shape.chart.series[0]
data_points = series.data_points
self.assertTrue(data_points.has_default_format(0))
self.assertFalse(data_points.has_default_format(1))
# Copy format of the data point with index 1 to the data point with index 2
# so that the data point 2 looks the same as the data point 1.
data_points.copy_format(0, 1)
self.assertTrue(data_points.has_default_format(0))
self.assertTrue(data_points.has_default_format(1))
# Copy format of the data point with index 0 to the series defaults so that all data points
# in the series that have the default format look the same as the data point 0.
series.copy_format_from(1)
self.assertTrue(data_points.has_default_format(0))
self.assertTrue(data_points.has_default_format(1))
doc.save(file_name=ARTIFACTS_DIR + 'Charts.CopyDataPointFormat.docx')

See Also