Back to Devexpress

Series.CustomDataPoints Property

officefileapi-devexpress-dot-spreadsheet-dot-charts-dot-series-41286bb0.md

latest3.6 KB
Original Source

Series.CustomDataPoints Property

Provides access to data points with a customized visual appearance.

Namespace : DevExpress.Spreadsheet.Charts

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
DataPointCollection CustomDataPoints { get; }
vb
ReadOnly Property CustomDataPoints As DataPointCollection

Property Value

TypeDescription
DataPointCollection

A DataPointCollection object that is the collection of customized data points.

|

Remarks

To change the visual appearance for a specific data point in a series, add an item to the DataPointCollection collection with the index equal to an index of the selected data point and use the DataPoint properties to specify its appearance.

For a chart of the ChartType.Pie3D type, you can use the DataPoint.Explosion property to set the point explosion, as illustrated in the following code sample.

The example below demonstrates how to create the 3-D pie chart and rotate it around the Y-axis by 225° using the View3DOptions.YRotation property.

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.Pie3D);
chart.TopLeftCell = worksheet.Cells["H2"];
chart.BottomRightCell = worksheet.Cells["N14"];

// Add the data series
chart.Series.Add(worksheet["E2"], worksheet["B3:B6"], worksheet["E3:E6"]);

// Set the explosion value for the slice
chart.Series[0].CustomDataPoints.Add(2).Explosion = 25;

// Set the rotation of the 3-D chart view
chart.View3D.YRotation = 255;

// Set the chart style
chart.Style = ChartStyle.ColorGradient;
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.Pie3D)
chart.TopLeftCell = worksheet.Cells("H2")
chart.BottomRightCell = worksheet.Cells("N14")

' Add the data series
chart.Series.Add(worksheet("E2"), worksheet("B3:B6"), worksheet("E3:E6"))

' Set the explosion value for the slice
chart.Series(0).CustomDataPoints.Add(2).Explosion = 25

' Set the rotation of the 3-D chart view
chart.View3D.YRotation = 255

' Set the chart style
chart.Style = ChartStyle.ColorGradient

See Also

Series Interface

Series Members

DevExpress.Spreadsheet.Charts Namespace