[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Collapse]Office File API
  Demo Application
  Redistribution and Deployment
 [Collapse]Spreadsheet Document API
   Product Structure
   Getting Started
  [Expand]Spreadsheet Document
   Supported Formats
  [Expand]Cell Basics
   Defined Names
   Data Binding
  [Expand]Pivot Tables
  [Expand]Charts and Graphics
  [Expand]Mail Merge
   [Expand]Rows and Columns
   [Expand]Import and Export Data
   [Expand]Data Binding
   [Expand]Mail Merge
     How to: Create Sparklines
     How to: Group and Ungroup Sparklines
     How to: Customize the Sparkline Appearance
     How to: Specify Sparkline Axis Settings
     How to: Delete Sparklines
   [Expand]Formatting Cells
   [Expand]Conditional Formatting
   [Expand]Group Data
   [Expand]Filter Data
   [Expand]Pivot Tables
 [Expand]Word Processing Document API
 [Expand]PDF Document API
 [Expand]Excel Export Library
 [Expand]Snap Report API
 [Expand]Zip Compression and Archive API
 [Expand]Barcode Generation API
 [Expand]Unit Conversion API
 [Expand]API Reference
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

How to: Group and Ungroup Sparklines

The examples below demonstrate how to group and ungroup sparklines on a worksheet.

Expanded Group Sparklines

As mentioned in the How to: Create Sparklines article, all sparklines in a worksheet are stored in sparkline groups. A group allows you to apply formatting and scaling options to all sparklines in the group at the same time. However, you can regroup the existing sparklines to form new groups with their own custom settings. To rearrange worksheet sparklines, follow the steps below.

  1. Get access to the sparklines you wish to regroup by their indices in the SparklineCollection collection accessible from the SparklineGroup.Sparklines property of the SparklineGroup objects containing the corresponding sparklines.
  2. Call the SparklineGroupCollection.Add method overload and pass the following parameters: a list of the sparklines to be grouped together, and the SparklineGroupType enumeration member that specifies the type of the created group.

You can also move a single sparkline to another group by using the Sparkline.MoveTo method.

The image below shows the result (the workbook is opened in Microsoft® Excel®).

Expanded Ungroup Sparklines

To split a set of grouped sparklines into individual sparkline charts, use the SparklineGroup.UnGroup method. Calling this method will split the specified group into separate groups, each of which contains a single Sparkline object. All groups generated this way will have the same type, formatting and axis options as the source group.

Expanded See Also

Is this topic helpful?​​​​​​​