ChartDataLabelCollectionShowSeriesName Property

Returns or sets a Boolean to indicate the series name display behavior for the data labels of the entire series. True to show the series name. False to hide. By default false.

Namespace:  Aspose.Words.Drawing.Charts
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public bool ShowSeriesName { get; set; }

Property Value

Type: Boolean
Remarks
Value defined for this property can be overridden for an individual data label with using the ShowSeriesName property.
Examples
Shows how to set default values for the data labels.
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");
See Also