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
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
FirstPointColor
Gets and sets the color of the first point of data in the sparkline group.
public CellsColor FirstPointColor { get; set; }
Property Value
HighPointColor
Gets and sets the color of the highest points of data in the sparkline group.
public CellsColor HighPointColor { get; set; }
Property Value
HorizontalAxisColor
Gets and sets the color of the horizontal axis in the sparkline group.
public CellsColor HorizontalAxisColor { get; set; }
Property Value
HorizontalAxisDateRange
Represents the range that contains the date values for the sparkline data.
public string HorizontalAxisDateRange { get; set; }
Property Value
LastPointColor
Gets and sets the color of the last point of data in the sparkline group.
public CellsColor LastPointColor { get; set; }
Property Value
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
LowPointColor
Gets and sets the color of the lowest points of data in the sparkline group.
public CellsColor LowPointColor { get; set; }
Property Value
MarkersColor
Gets and sets the color of points in each line sparkline in the sparkline group.
public CellsColor MarkersColor { get; set; }
Property Value
NegativePointsColor
Gets and sets the color of the negative values on the sparkline group.
public CellsColor NegativePointsColor { get; set; }
Property Value
PlotEmptyCellsType
Indicates how to plot empty cells.
public PlotEmptyCellsType PlotEmptyCellsType { get; set; }
Property Value
PlotRightToLeft
Indicates whether the plot data is right to left.
public bool PlotRightToLeft { get; set; }
Property Value
PresetStyle
Gets and sets the preset style type of the sparkline group.
public SparklinePresetStyleType PresetStyle { get; set; }
Property Value
SeriesColor
Gets and sets the color of the sparklines in the sparkline group.
public CellsColor SeriesColor { get; set; }
Property Value
ShowFirstPoint
Indicates whether to highlight the first point of data in the sparkline group.
public bool ShowFirstPoint { get; set; }
Property Value
ShowHighPoint
Indicates whether to highlight the highest points of data in the sparkline group.
public bool ShowHighPoint { get; set; }
Property Value
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
ShowLastPoint
Indicates whether to highlight the last point of data in the sparkline group.
public bool ShowLastPoint { get; set; }
Property Value
ShowLowPoint
Indicates whether to highlight the lowest points of data in the sparkline group.
public bool ShowLowPoint { get; set; }
Property Value
ShowMarkers
Indicates whether to highlight each point in each line sparkline in the sparkline group.
public bool ShowMarkers { get; set; }
Property Value
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
Sparklines
Gets the collection of Aspose.Cells.Charts.Sparkline object.
public SparklineCollection Sparklines { get; }
Property Value
Type
Indicates the sparkline type of the sparkline group.
public SparklineType Type { get; set; }
Property Value
VerticalAxisMaxValue
Gets and sets the custom maximum value for the vertical axis.
public double VerticalAxisMaxValue { get; set; }
Property Value
VerticalAxisMaxValueType
Represents the vertical axis maximum value type.
public SparklineAxisMinMaxType VerticalAxisMaxValueType { get; set; }
Property Value
VerticalAxisMinValue
Gets and sets the custom minimum value for the vertical axis.
public double VerticalAxisMinValue { get; set; }
Property Value
VerticalAxisMinValueType
Represents the vertical axis minimum value type.
public SparklineAxisMinMaxType VerticalAxisMinValueType { get; set; }
Property Value
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.