Aspose::Words::Drawing::Charts::ChartDataPointCollection::HasDefaultFormat method
Contents
[
Hide
]ChartDataPointCollection::HasDefaultFormat method
Gets a flag indicating whether the data point at the specified index has default format.
bool Aspose::Words::Drawing::Charts::ChartDataPointCollection::HasDefaultFormat(int32_t dataPointIndex)
Examples
Shows how to copy data point format.
auto doc = System::MakeObject<Aspose::Words::Document>(get_MyDir() + u"DataPoint format.docx");
// Get the chart and series to update format.
auto shape = System::ExplicitCast<Aspose::Words::Drawing::Shape>(doc->GetChild(Aspose::Words::NodeType::Shape, 0, true));
System::SharedPtr<Aspose::Words::Drawing::Charts::ChartSeries> series = shape->get_Chart()->get_Series()->idx_get(0);
System::SharedPtr<Aspose::Words::Drawing::Charts::ChartDataPointCollection> dataPoints = series->get_DataPoints();
ASSERT_TRUE(dataPoints->HasDefaultFormat(0));
ASSERT_FALSE(dataPoints->HasDefaultFormat(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.
dataPoints->CopyFormat(0, 1);
ASSERT_TRUE(dataPoints->HasDefaultFormat(0));
ASSERT_TRUE(dataPoints->HasDefaultFormat(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->CopyFormatFrom(1);
ASSERT_TRUE(dataPoints->HasDefaultFormat(0));
ASSERT_TRUE(dataPoints->HasDefaultFormat(1));
doc->Save(get_ArtifactsDir() + u"Charts.CopyDataPointFormat.docx");
See Also
- Class ChartDataPointCollection
- Namespace Aspose::Words::Drawing::Charts
- Library Aspose.Words for C++