Back to Devexpress

SparklineGroup.Points Property

officefileapi-devexpress-dot-spreadsheet-dot-sparklinegroup-0dfce601.md

latest5.6 KB
Original Source

SparklineGroup.Points Property

Provides access to the settings that control the visual appearance of sparkline data points.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
SparklinePoints Points { get; }
vb
ReadOnly Property Points As SparklinePoints

Property Value

TypeDescription
SparklinePoints

A SparklinePoints object that contains the marker options.

|

Remarks

Use the Points property to highlight important data points on a sparkline. For example, you can differentiate markers for the first and last data points (SparklinePoints.First and SparklinePoints.Last), highest and lowest values (SparklinePoints.Highest and SparklinePoints.Lowest), or negative values (SparklinePoints.Negative) by using a specific color to paint each point.

The example below demonstrates how to create a group of line sparklines and customize its appearance. Use the SparklinePoints.Markers property to display data markers on a line, and then utilize different colors to highlight the highest and lowest data points on each sparkline.

View Example

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

// Create a group of line sparklines.
SparklineGroup lineGroup = worksheet.SparklineGroups.Add(worksheet["G4:G7"], worksheet["C4:F4,C5:F5,C6:F6, C7:F7"], SparklineGroupType.Line);

// Customize the group appearance.
// Set the sparkline color.
lineGroup.SeriesColor = Color.FromArgb(0x1F, 0x49, 0x7D);

// Set the sparkline weight.
lineGroup.LineWeight = 1.5;

// Display data markers on the sparklines and specify their color.
SparklinePoints points = lineGroup.Points;
points.Markers.IsVisible = true;
points.Markers.Color = Color.FromArgb(0x4B, 0xAC, 0xC6);

// Highlight the highest and lowest points on each sparkline in the group.
points.Highest.Color = Color.FromArgb(0xA9, 0xD6, 0x4F);
points.Lowest.Color = Color.FromArgb(0x80, 0x64, 0xA2);
vb
Dim worksheet As Worksheet = workbook.Worksheets("SparklineExamples")
workbook.Worksheets.ActiveWorksheet = worksheet

' Create a group of line sparklines.
Dim lineGroup As SparklineGroup = worksheet.SparklineGroups.Add(worksheet("G4:G7"), worksheet("C4:F4,C5:F5,C6:F6, C7:F7"), SparklineGroupType.Line)

' Customize the group appearance.
' Set the sparkline color.
lineGroup.SeriesColor = Color.FromArgb(&H1F, &H49, &H7D)

' Set the sparkline weight.
lineGroup.LineWeight = 1.5

' Display data markers on the sparklines and specify their color.
Dim points As SparklinePoints = lineGroup.Points
points.Markers.IsVisible = True
points.Markers.Color = Color.FromArgb(&H4B, &HAC, &HC6)

' Highlight the highest and lowest points on each sparkline in the group.
points.Highest.Color = Color.FromArgb(&HA9, &HD6, &H4F)
points.Lowest.Color = Color.FromArgb(&H80, &H64, &HA2)

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Points 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.

spreadsheet-document-api-chart-examples/CS/SpreadsheetDocServerChartAPISamples/CodeExamples/SparklineActions.cs#L63

csharp
// Display data markers on the sparklines and specify their color.
SparklinePoints points = lineGroup.Points;
points.Markers.IsVisible = true;

spreadsheet-document-api-chart-examples/VB/SpreadsheetDocServerChartAPISamples/CodeExamples/SparklineActions.vb#L61

vb
' Display data markers on the sparklines and specify their color.
Dim points As SparklinePoints = lineGroup.Points
points.Markers.IsVisible = True

See Also

SparklineGroup Interface

SparklineGroup Members

DevExpress.Spreadsheet Namespace