ChartDataLabelCollectionShowSeriesName Property |
Namespace: Aspose.Words.Drawing.Charts
Document doc = new Document(); DocumentBuilder builder = new DocumentBuilder(doc); // Insert bubble chart Shape shapeWithBubbleChart = builder.InsertChart(ChartType.Bubble, 432, 252); // Clear demo data shapeWithBubbleChart.Chart.Series.Clear(); ChartSeries bubbleChartSeries = shapeWithBubbleChart.Chart.Series.Add("Aspose Test Series", new[] { 2.9, 3.5, 1.1, 4, 4 }, new[] { 1.9, 8.5, 2.1, 6, 1.5 }, new[] { 9, 4.5, 2.5, 8, 5 }); // Set default values for the bubble chart data labels ChartDataLabelCollection bubbleChartDataLabels = bubbleChartSeries.DataLabels; bubbleChartDataLabels.ShowBubbleSize = true; bubbleChartDataLabels.ShowCategoryName = true; bubbleChartDataLabels.ShowSeriesName = true; bubbleChartDataLabels.Separator = " - "; builder.InsertBreak(BreakType.PageBreak); // Insert pie chart Shape shapeWithPieChart = builder.InsertChart(ChartType.Pie, 432, 252); // Clear demo data shapeWithPieChart.Chart.Series.Clear(); ChartSeries pieChartSeries = shapeWithPieChart.Chart.Series.Add("Aspose Test Series", new string[] { "Word", "PDF", "Excel" }, new double[] { 2.7, 3.2, 0.8 }); // Set default values for the pie chart data labels ChartDataLabelCollection pieChartDataLabels = pieChartSeries.DataLabels; pieChartDataLabels.ShowLeaderLines = true; pieChartDataLabels.ShowLegendKey = true; pieChartDataLabels.ShowPercentage = true; pieChartDataLabels.ShowValue = true; doc.Save(ArtifactsDir + "Charts.ChartDataLabelCollection.docx");