Back to Devexpress

Series.Values Property

officefileapi-devexpress-dot-spreadsheet-dot-charts-dot-series-4c2f3459.md

latest5.4 KB
Original Source

Series.Values Property

Gets or sets the data used as series point values.

Namespace : DevExpress.Spreadsheet.Charts

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
ChartData Values { get; set; }
vb
Property Values As ChartData

Property Value

TypeDescription
ChartData

A ChartData object specifying data for chart data points.

|

Remarks

You can use the ChartData.FromRange method to create chart data object from a worksheet cell range and assign it to the Values property. Use the ChartData.FromArray method or implicit type conversion to specify an array of values.

The code snippet illustrates how to specify an array of values as the data source for series arguments and values.

View Example

csharp
Worksheet worksheet = workbook.Worksheets["Sheet1"];
workbook.Worksheets.ActiveWorksheet = worksheet;
workbook.BeginUpdate();

// Create a chart.
Chart chart = worksheet.Charts.Add(ChartType.LineMarker, worksheet[0,0]);
// Specify arguments.
chart.Series[0].Arguments = new CellValue[] {1,2,3};
// Specify values.
chart.Series[0].Values = new CellValue[] { 30, 20, 10 };

workbook.EndUpdate();
vb
Dim worksheet As Worksheet = workbook.Worksheets("Sheet1")
workbook.Worksheets.ActiveWorksheet = worksheet
workbook.BeginUpdate()

' Create a chart.
Dim chart As Chart = worksheet.Charts.Add(ChartType.LineMarker, worksheet(0,0))
' Specify arguments.
chart.Series(0).Arguments = New CellValue() {1,2,3}
' Specify values.
chart.Series(0).Values = New CellValue() { 30, 20, 10 }

workbook.EndUpdate()

The following code snippets (auto-collected from DevExpress Examples) contain references to the Values 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/SeriesActions.cs#L95

csharp
// Specify values.
chart.Series[0].Values = new CellValue[] { 30, 20, 10 };

winforms-spreadsheet-chart-api/CS/SpreadsheetChartAPISamples/CodeExamples/SeriesActions.cs#L95

csharp
// Specify values.
chart.Series[0].Values = new CellValue[] { 30, 20, 10 };

spreadsheet-document-api-chart-examples/CS/SpreadsheetDocServerChartAPISamples/CodeExamples/SeriesActions.cs#L102

csharp
// Specify values.
chart.Series[0].Values = new CellValue[] { 30, 20, 10 };

wpf-spreadsheet-chart-api/VB/SpreadsheetWPFChartAPISamples/CodeExamples/SeriesActions.vb#L98

vb
' Specify values.
chart.Series(0).Values = New CellValue() { 30, 20, 10 }

winforms-spreadsheet-chart-api/VB/SpreadsheetChartAPISamples/CodeExamples/SeriesActions.vb#L97

vb
' Specify values.
chart.Series(0).Values = New CellValue() { 30, 20, 10 }

spreadsheet-document-api-chart-examples/VB/SpreadsheetDocServerChartAPISamples/CodeExamples/SeriesActions.vb#L96

vb
' Specify values.
chart.Series(0).Values = New CellValue() {30, 20, 10}

See Also

Series Interface

Series Members

DevExpress.Spreadsheet.Charts Namespace