Class SparklineGroup

Class SparklineGroup

Namespace: Aspose.Cells.Charts
Assembly: Aspose.Cells.dll (25.2.0)

Aspose.Cells.Charts.Sparkline is organized into sparkline group. A SparklineGroup contains a variable number of sparkline items. A sparkline group specifies the type, display settings and axis settings for the sparklines.

public class SparklineGroup

Inheritance

objectSparklineGroup

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Examples

csharp
[C#]
 Workbook book = new Workbook(); 
 Worksheet sheet = book.Worksheets[0];

 sheet.Cells["A1"].PutValue(5);
 sheet.Cells["B1"].PutValue(2);
 sheet.Cells["C1"].PutValue(1);
 sheet.Cells["D1"].PutValue(3);

 // Define the CellArea
 CellArea ca = new CellArea();
 ca.StartColumn = 4;
 ca.EndColumn = 4;
 ca.StartRow = 0;
 ca.EndRow = 0;
 int idx = sheet.SparklineGroups.Add(Aspose.Cells.Charts.SparklineType.Line, "A1:D1", false, ca);
 SparklineGroup group = sheet.SparklineGroups[idx];
 group.Sparklines.Add(sheet.Name + "!A1:D1", 0, 4);
 // Create CellsColor
 CellsColor clr = book.CreateCellsColor();
 clr.Color = Color.Orange;
 group.SeriesColor = clr;

 // set the high points are colored green and the low points are colored red
 group.ShowHighPoint = true;
 group.ShowLowPoint = true;
 group.HighPointColor.Color = Color.Green;
 group.LowPointColor.Color = Color.Red;
 // set line weight 
 group.LineWeight = 1.0;
 book.Save("output.xlsx", SaveFormat.Xlsx);

Properties

DisplayHidden

Indicates whether to show data in hidden rows and columns.

public bool DisplayHidden { get; set; }

Property Value

bool

FirstPointColor

Gets and sets the color of the first point of data in the sparkline group.

public CellsColor FirstPointColor { get; set; }

Property Value

CellsColor

HighPointColor

Gets and sets the color of the highest points of data in the sparkline group.

public CellsColor HighPointColor { get; set; }

Property Value

CellsColor

HorizontalAxisColor

Gets and sets the color of the horizontal axis in the sparkline group.

public CellsColor HorizontalAxisColor { get; set; }

Property Value

CellsColor

HorizontalAxisDateRange

Represents the range that contains the date values for the sparkline data.

public string HorizontalAxisDateRange { get; set; }

Property Value

string

LastPointColor

Gets and sets the color of the last point of data in the sparkline group.

public CellsColor LastPointColor { get; set; }

Property Value

CellsColor

LineWeight

Gets and sets the line weight in each line sparkline in the sparkline group, in the unit of points.

public double LineWeight { get; set; }

Property Value

double

LowPointColor

Gets and sets the color of the lowest points of data in the sparkline group.

public CellsColor LowPointColor { get; set; }

Property Value

CellsColor

MarkersColor

Gets and sets the color of points in each line sparkline in the sparkline group.

public CellsColor MarkersColor { get; set; }

Property Value

CellsColor

NegativePointsColor

Gets and sets the color of the negative values on the sparkline group.

public CellsColor NegativePointsColor { get; set; }

Property Value

CellsColor

PlotEmptyCellsType

Indicates how to plot empty cells.

public PlotEmptyCellsType PlotEmptyCellsType { get; set; }

Property Value

PlotEmptyCellsType

PlotRightToLeft

Indicates whether the plot data is right to left.

public bool PlotRightToLeft { get; set; }

Property Value

bool

PresetStyle

Gets and sets the preset style type of the sparkline group.

public SparklinePresetStyleType PresetStyle { get; set; }

Property Value

SparklinePresetStyleType

SeriesColor

Gets and sets the color of the sparklines in the sparkline group.

public CellsColor SeriesColor { get; set; }

Property Value

CellsColor

ShowFirstPoint

Indicates whether to highlight the first point of data in the sparkline group.

public bool ShowFirstPoint { get; set; }

Property Value

bool

ShowHighPoint

Indicates whether to highlight the highest points of data in the sparkline group.

public bool ShowHighPoint { get; set; }

Property Value

bool

ShowHorizontalAxis

Indicates whether to show the sparkline horizontal axis. The horizontal axis appears if the sparkline has data that crosses the zero axis.

public bool ShowHorizontalAxis { get; set; }

Property Value

bool

ShowLastPoint

Indicates whether to highlight the last point of data in the sparkline group.

public bool ShowLastPoint { get; set; }

Property Value

bool

ShowLowPoint

Indicates whether to highlight the lowest points of data in the sparkline group.

public bool ShowLowPoint { get; set; }

Property Value

bool

ShowMarkers

Indicates whether to highlight each point in each line sparkline in the sparkline group.

public bool ShowMarkers { get; set; }

Property Value

bool

ShowNegativePoints

Indicates whether to highlight the negative values on the sparkline group with a different color or marker.

public bool ShowNegativePoints { get; set; }

Property Value

bool

Sparklines

Gets the collection of Aspose.Cells.Charts.Sparkline object.

public SparklineCollection Sparklines { get; }

Property Value

SparklineCollection

Type

Indicates the sparkline type of the sparkline group.

public SparklineType Type { get; set; }

Property Value

SparklineType

VerticalAxisMaxValue

Gets and sets the custom maximum value for the vertical axis.

public double VerticalAxisMaxValue { get; set; }

Property Value

double

VerticalAxisMaxValueType

Represents the vertical axis maximum value type.

public SparklineAxisMinMaxType VerticalAxisMaxValueType { get; set; }

Property Value

SparklineAxisMinMaxType

VerticalAxisMinValue

Gets and sets the custom minimum value for the vertical axis.

public double VerticalAxisMinValue { get; set; }

Property Value

double

VerticalAxisMinValueType

Represents the vertical axis minimum value type.

public SparklineAxisMinMaxType VerticalAxisMinValueType { get; set; }

Property Value

SparklineAxisMinMaxType

Methods

ResetRanges(string, bool, CellArea)

Resets the data range and location range of the sparkline group. This method will clear original sparkline items in the group and creates new sparkline items for the new ranges.

public void ResetRanges(string dataRange, bool isVertical, CellArea locationRange)

Parameters

dataRange string

Specifies the new data range of the sparkline group.

isVertical bool

Specifies whether to plot the sparklines from the new data range by row or by column.

locationRange CellArea

Specifies where the sparklines to be placed.