Back to Devexpress

DataLabelBase.ShowValue Property

officefileapi-devexpress-dot-spreadsheet-dot-charts-dot-datalabelbase-78c9a6a7.md

latest5.1 KB
Original Source

DataLabelBase.ShowValue Property

Gets or sets a value indicating whether the data point value should be displayed in a data label.

Namespace : DevExpress.Spreadsheet.Charts

Assembly : DevExpress.Spreadsheet.v25.2.Core.dll

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
bool ShowValue { get; set; }
vb
Property ShowValue As Boolean

Property Value

TypeDescription
Boolean

true , to show value labels; otherwise, false.

|

Example

The example below demonstrates how to create a clustered column chart and display value labels for all series.

View Example

csharp
Worksheet worksheet = workbook.Worksheets["chartTask3"];
workbook.Worksheets.ActiveWorksheet = worksheet;

// Create a chart and specify its location.
Chart chart = worksheet.Charts.Add(ChartType.ColumnClustered, worksheet["B2:D4"]);
chart.TopLeftCell = worksheet.Cells["H2"];
chart.BottomRightCell = worksheet.Cells["N14"];

// Show data labels.
chart.Views[0].DataLabels.ShowValue = true;
vb
Dim worksheet As Worksheet = workbook.Worksheets("chartTask3")
workbook.Worksheets.ActiveWorksheet = worksheet

' Create a chart and specify its location.
Dim chart As Chart = worksheet.Charts.Add(ChartType.ColumnClustered, worksheet("B2:D4"))
chart.TopLeftCell = worksheet.Cells("H2")
chart.BottomRightCell = worksheet.Cells("N14")

' Show data labels.
chart.Views(0).DataLabels.ShowValue = True

The following code snippets (auto-collected from DevExpress Examples) contain references to the ShowValue property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

wpf-spreadsheet-chart-api/CS/SpreadsheetWPFChartAPISamples/CodeExamples/DataLabelsActions.cs#L22

csharp
// Show data labels.
chart.Views[0].DataLabels.ShowValue = true;

winforms-spreadsheet-chart-api/CS/SpreadsheetChartAPISamples/CodeExamples/DataLabelsActions.cs#L22

csharp
// Show data labels.
chart.Views[0].DataLabels.ShowValue = true;

spreadsheet-document-api-chart-examples/CS/SpreadsheetDocServerChartAPISamples/CodeExamples/DataLabelsActions.cs#L28

csharp
// Show data labels.
chart.Views[0].DataLabels.ShowValue = true;

wpf-spreadsheet-chart-api/VB/SpreadsheetWPFChartAPISamples/CodeExamples/TrendlineActions.vb#L26

vb
' Show data labels.
chart.Views(0).DataLabels.ShowValue = True

winforms-spreadsheet-chart-api/VB/SpreadsheetChartAPISamples/CodeExamples/DataLabelsActions.vb#L25

vb
' Show data labels.
chart.Views(0).DataLabels.ShowValue = True

spreadsheet-document-api-chart-examples/VB/SpreadsheetDocServerChartAPISamples/CodeExamples/TrendlineActions.vb#L31

vb
' Show data labels.
chart.Views(0).DataLabels.ShowValue = True

See Also

DataLabelBase Interface

DataLabelBase Members

DevExpress.Spreadsheet.Charts Namespace