Skip to main content
Row

SparklineGroupCollection.Add(IList<Sparkline>, SparklineGroupType) Method

Creates a new sparkline group from the existing sparklines and returns the SparklineGroup object.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.1.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

SparklineGroup Add(
    IList<Sparkline> sparklines,
    SparklineGroupType type
)

Parameters

Name Type Description
sparklines IList<Sparkline>

A list of the Sparkline objects to form a group.

type SparklineGroupType

A SparklineGroupType enumeration member specifying the type of the group to be created.

Returns

Type Description
SparklineGroup

A SparklineGroup object that is the newly created group of sparklines.

Remarks

Use this method to rearrange the existing Sparkline objects in a worksheet to form a new group with its own settings.

View Example

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);

// Rearrange sparklines by grouping the second and fourth sparklines together and changing the group type to "Column".
Sparkline sparklineG5 = lineGroup.Sparklines[1];
Sparkline sparklineG7 = lineGroup.Sparklines[3];
SparklineGroup columnGroup = worksheet.SparklineGroups.Add(new List<Sparkline> { sparklineG5, sparklineG7 }, SparklineGroupType.Column);

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Add(IList<Sparkline>, SparklineGroupType) method.

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.

See Also