Back to Devexpress

Sparkline Interface

officefileapi-devexpress-dot-spreadsheet-e1fafcdc.md

latest3.5 KB
Original Source

Sparkline Interface

Represents a single sparkline in the sparkline group.

Namespace : DevExpress.Spreadsheet

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

NuGet Package : DevExpress.Spreadsheet.Core

Declaration

csharp
public interface Sparkline
vb
Public Interface Sparkline

The following members return Sparkline objects:

Remarks

The Sparkline object is contained within the SparklineCollection collection. The SparklineGroup.Sparklines property provides access to a collection that contains all sparklines for the specified sparkline group.

The code example below demonstrates how to use the SparklineCollection.Add method to add a new Sparkline object to the existing sparkline group.

View Example

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

// Create a group of line sparklines.
SparklineGroup quarterlyGroup = worksheet.SparklineGroups.Add(worksheet["G4:G6"], worksheet["C4:F4,C5:F5,C6:F6"], SparklineGroupType.Line);
// Add one more sparkline to the existing group.
quarterlyGroup.Sparklines.Add(6, 6, worksheet["C7:F7"]);

// Display a column sparkline in the total cell.
SparklineGroup totalGroup = worksheet.SparklineGroups.Add(worksheet["G8"], worksheet["C8:F8"], SparklineGroupType.Column);
vb
Dim worksheet As Worksheet = workbook.Worksheets("SparklineExamples")
workbook.Worksheets.ActiveWorksheet = worksheet

' Create a group of line sparklines.
Dim quarterlyGroup As SparklineGroup = worksheet.SparklineGroups.Add(worksheet("G4:G6"), worksheet("C4:F4,C5:F5,C6:F6"), SparklineGroupType.Line)
' Add one more sparkline to the existing group.
quarterlyGroup.Sparklines.Add(6, 6, worksheet("C7:F7"))

' Display a column sparkline in the total cell.
Dim totalGroup As SparklineGroup = worksheet.SparklineGroups.Add(worksheet("G8"), worksheet("C8:F8"), SparklineGroupType.Column)

To change the location of a single sparkline in a worksheet, use the Sparkline.SetPosition method. To modify a source data range for a sparkline, use the Sparkline.DataRange property.

See Also

Sparkline Members

DevExpress.Spreadsheet Namespace