XlSparklineGroup.SparklineType Property
Gets or sets the type of a sparkline group.
Namespace: DevExpress.Export.Xl
Assembly: DevExpress.Printing.v24.1.Core.dll
NuGet Package: DevExpress.Printing.Core
Declaration
Property Value
Type | Description |
---|---|
XlSparklineType | A XlSparklineType enumeration member value that specifies the sparkline group type. |
Available values:
Name | Description |
---|---|
Line | Sparkline data points are plotted as a line. |
Column | Sparkline data points are plotted as vertical bars. |
WinLoss | Sparkline data points are plotted with identically sized bars above the horizontal axis for positive values (win) and below the horizontal axis for negative values (loss), |
Example
Note
A complete sample project is available at https://github.com/DevExpress-Examples/excel-export-api-examples
// Create a sparkline group.
XlSparklineGroup group = new XlSparklineGroup(XlCellRange.FromLTRB(1, 1, 8, 6), XlCellRange.FromLTRB(9, 1, 9, 6));
// Change the sparkline group type to "Column".
group.SparklineType = XlSparklineType.Column;
// Display the horizontal axis.
group.DisplayXAxis = true;
// Set the series color.
group.ColorSeries = XlColor.FromTheme(XlThemeColor.Accent1, 0.0);
// Highlight negative points on each sparkline in the group.
group.ColorNegative = XlColor.FromTheme(XlThemeColor.Accent2, 0.0);
group.HighlightNegative = true;
sheet.SparklineGroups.Add(group);
See Also