Aspose::Words::Drawing::Charts::ChartSeries::Insert method
ChartSeries::Insert(int32_t, const System::SharedPtr<Aspose::Words::Drawing::Charts::ChartXValue> &) method
Inserts the specified X value into the chart series at the specified index. If the series supports Y values and bubble sizes, they will be empty for the X value.
void Aspose::Words::Drawing::Charts::ChartSeries::Insert(int32_t index, const System::SharedPtr<Aspose::Words::Drawing::Charts::ChartXValue> & xValue)
Remarks
The corresponding data point with default formatting will be inserted into the data point collection. And, if data labels are displayed, the corresponding data label with default formatting will be inserted too.
Examples
Shows how to insert data into a chart series.
auto doc = System::MakeObject<Aspose::Words::Document>();
auto builder = System::MakeObject<Aspose::Words::DocumentBuilder>(doc);
System::SharedPtr<Aspose::Words::Drawing::Shape> shape = builder->InsertChart(ChartType::Line, static_cast<double>(432), static_cast<double>(252));
System::SharedPtr<Aspose::Words::Drawing::Charts::Chart> chart = shape->get_Chart();
System::SharedPtr<Aspose::Words::Drawing::Charts::ChartSeries> series1 = chart->get_Series()->idx_get(0);
// Clear X and Y values of the first series.
series1->ClearValues();
// Populate the series with data.
series1->Insert(0, ChartXValue::FromDouble(3));
series1->Insert(1, ChartXValue::FromDouble(3), ChartYValue::FromDouble(10));
series1->Insert(2, ChartXValue::FromDouble(3), ChartYValue::FromDouble(10));
series1->Insert(3, ChartXValue::FromDouble(3), ChartYValue::FromDouble(10), static_cast<double>(10));
doc->Save(get_ArtifactsDir() + u"Charts.PopulateChartWithData.docx");
See Also
- Class ChartSeries
- Namespace Aspose::Words::Drawing::Charts
- Library Aspose.Words for C++
ChartSeries::Insert(int32_t, const System::SharedPtr<Aspose::Words::Drawing::Charts::ChartXValue> &, const System::SharedPtr<Aspose::Words::Drawing::Charts::ChartYValue> &) method
Inserts the specified X and Y values into the chart series at the specified index.
void Aspose::Words::Drawing::Charts::ChartSeries::Insert(int32_t index, const System::SharedPtr<Aspose::Words::Drawing::Charts::ChartXValue> & xValue, const System::SharedPtr<Aspose::Words::Drawing::Charts::ChartYValue> & yValue)
Remarks
The corresponding data point with default formatting will be inserted into the data point collection. And, if data labels are displayed, the corresponding data label with default formatting will be inserted too.
Examples
Shows how to insert data into a chart series.
auto doc = System::MakeObject<Aspose::Words::Document>();
auto builder = System::MakeObject<Aspose::Words::DocumentBuilder>(doc);
System::SharedPtr<Aspose::Words::Drawing::Shape> shape = builder->InsertChart(ChartType::Line, static_cast<double>(432), static_cast<double>(252));
System::SharedPtr<Aspose::Words::Drawing::Charts::Chart> chart = shape->get_Chart();
System::SharedPtr<Aspose::Words::Drawing::Charts::ChartSeries> series1 = chart->get_Series()->idx_get(0);
// Clear X and Y values of the first series.
series1->ClearValues();
// Populate the series with data.
series1->Insert(0, ChartXValue::FromDouble(3));
series1->Insert(1, ChartXValue::FromDouble(3), ChartYValue::FromDouble(10));
series1->Insert(2, ChartXValue::FromDouble(3), ChartYValue::FromDouble(10));
series1->Insert(3, ChartXValue::FromDouble(3), ChartYValue::FromDouble(10), static_cast<double>(10));
doc->Save(get_ArtifactsDir() + u"Charts.PopulateChartWithData.docx");
See Also
- Class ChartSeries
- Namespace Aspose::Words::Drawing::Charts
- Library Aspose.Words for C++
ChartSeries::Insert(int32_t, const System::SharedPtr<Aspose::Words::Drawing::Charts::ChartXValue> &, const System::SharedPtr<Aspose::Words::Drawing::Charts::ChartYValue> &, double) method
Inserts the specified X value, Y value and bubble size into the chart series at the specified index.
void Aspose::Words::Drawing::Charts::ChartSeries::Insert(int32_t index, const System::SharedPtr<Aspose::Words::Drawing::Charts::ChartXValue> & xValue, const System::SharedPtr<Aspose::Words::Drawing::Charts::ChartYValue> & yValue, double bubbleSize)
Remarks
The corresponding data point with default formatting will be inserted into the data point collection. And, if data labels are displayed, the corresponding data label with default formatting will be inserted too.
Examples
Shows how to insert data into a chart series.
auto doc = System::MakeObject<Aspose::Words::Document>();
auto builder = System::MakeObject<Aspose::Words::DocumentBuilder>(doc);
System::SharedPtr<Aspose::Words::Drawing::Shape> shape = builder->InsertChart(ChartType::Line, static_cast<double>(432), static_cast<double>(252));
System::SharedPtr<Aspose::Words::Drawing::Charts::Chart> chart = shape->get_Chart();
System::SharedPtr<Aspose::Words::Drawing::Charts::ChartSeries> series1 = chart->get_Series()->idx_get(0);
// Clear X and Y values of the first series.
series1->ClearValues();
// Populate the series with data.
series1->Insert(0, ChartXValue::FromDouble(3));
series1->Insert(1, ChartXValue::FromDouble(3), ChartYValue::FromDouble(10));
series1->Insert(2, ChartXValue::FromDouble(3), ChartYValue::FromDouble(10));
series1->Insert(3, ChartXValue::FromDouble(3), ChartYValue::FromDouble(10), static_cast<double>(10));
doc->Save(get_ArtifactsDir() + u"Charts.PopulateChartWithData.docx");
See Also
- Class ChartSeries
- Namespace Aspose::Words::Drawing::Charts
- Library Aspose.Words for C++