Insert
Insert(int, ChartXValue)
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.
public void Insert(int index, 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.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.InsertChart(ChartType.Line, 432, 252);
Chart chart = shape.Chart;
ChartSeries series1 = chart.Series[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), 10);
doc.Save(ArtifactsDir + "Charts.PopulateChartWithData.docx");
See Also
- class ChartXValue
- class ChartSeries
- namespace Aspose.Words.Drawing.Charts
- assembly Aspose.Words
Insert(int, ChartXValue, ChartYValue)
Inserts the specified X and Y values into the chart series at the specified index.
public void Insert(int index, ChartXValue xValue, 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.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.InsertChart(ChartType.Line, 432, 252);
Chart chart = shape.Chart;
ChartSeries series1 = chart.Series[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), 10);
doc.Save(ArtifactsDir + "Charts.PopulateChartWithData.docx");
See Also
- class ChartXValue
- class ChartYValue
- class ChartSeries
- namespace Aspose.Words.Drawing.Charts
- assembly Aspose.Words
Insert(int, ChartXValue, ChartYValue, double)
Inserts the specified X value, Y value and bubble size into the chart series at the specified index.
public void Insert(int index, ChartXValue xValue, 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.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Shape shape = builder.InsertChart(ChartType.Line, 432, 252);
Chart chart = shape.Chart;
ChartSeries series1 = chart.Series[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), 10);
doc.Save(ArtifactsDir + "Charts.PopulateChartWithData.docx");
See Also
- class ChartXValue
- class ChartYValue
- class ChartSeries
- namespace Aspose.Words.Drawing.Charts
- assembly Aspose.Words