Class SparklineGroup
Namespace: Aspose.Cells.Charts
Assembly: Aspose.Cells.dll (25.2.0)
Aspose.Cells.Charts.Sparkline 组织为 sparkline 组。一个 SparklineGroup 包含可变数量的 sparkline 项。
sparkline 组指定 sparkline 的类型、显示设置和轴设置。
public class SparklineGroup
继承
继承成员
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
示例
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);
// 定义 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);
// 创建 CellsColor
CellsColor clr = book.CreateCellsColor();
clr.Color = Color.Orange;
group.SeriesColor = clr;
// 设置高点为绿色,低点为红色
group.ShowHighPoint = true;
group.ShowLowPoint = true;
group.HighPointColor.Color = Color.Green;
group.LowPointColor.Color = Color.Red;
// 设置线条粗细
group.LineWeight = 1.0;
book.Save("output.xlsx", SaveFormat.Xlsx);
属性
DisplayHidden
指示是否显示隐藏行和列中的数据。
public bool DisplayHidden { get; set; }
属性值
FirstPointColor
获取和设置 sparkline 组中第一个数据点的颜色。
public CellsColor FirstPointColor { get; set; }
属性值
HighPointColor
获取和设置 sparkline 组中最高数据点的颜色。
public CellsColor HighPointColor { get; set; }
属性值
HorizontalAxisColor
获取和设置 sparkline 组中水平轴的颜色。
public CellsColor HorizontalAxisColor { get; set; }
属性值
HorizontalAxisDateRange
表示包含 sparkline 数据的日期值的范围。
public string HorizontalAxisDateRange { get; set; }
属性值
LastPointColor
获取和设置 sparkline 组中最后一个数据点的颜色。
public CellsColor LastPointColor { get; set; }
属性值
LineWeight
获取和设置 sparkline 组中每条线 sparkline 的线条粗细,单位为点。
public double LineWeight { get; set; }
属性值
LowPointColor
获取和设置 sparkline 组中最低数据点的颜色。
public CellsColor LowPointColor { get; set; }
属性值
MarkersColor
获取和设置 sparkline 组中每条线 sparkline 中点的颜色。
public CellsColor MarkersColor { get; set; }
属性值
NegativePointsColor
获取和设置 sparkline 组中负值的颜色。
public CellsColor NegativePointsColor { get; set; }
属性值
PlotEmptyCellsType
指示如何绘制空单元格。
public PlotEmptyCellsType PlotEmptyCellsType { get; set; }
属性值
PlotRightToLeft
指示绘图数据是否从右到左。
public bool PlotRightToLeft { get; set; }
属性值
PresetStyle
获取和设置 sparkline 组的预设样式类型。
public SparklinePresetStyleType PresetStyle { get; set; }
属性值
SeriesColor
获取和设置 sparkline 组中 sparkline 的颜色。
public CellsColor SeriesColor { get; set; }
属性值
ShowFirstPoint
指示是否突出显示 sparkline 组中第一个数据点。
public bool ShowFirstPoint { get; set; }
属性值
ShowHighPoint
指示是否突出显示 sparkline 组中最高的数据点。
public bool ShowHighPoint { get; set; }
属性值
ShowHorizontalAxis
指示是否显示 sparkline 水平轴。
如果 sparkline 的数据穿过零轴,则会显示水平轴。
public bool ShowHorizontalAxis { get; set; }
属性值
ShowLastPoint
指示是否突出显示 sparkline 组中最后一个数据点。
public bool ShowLastPoint { get; set; }
属性值
ShowLowPoint
指示是否突出显示 sparkline 组中最低的数据点。
public bool ShowLowPoint { get; set; }
属性值
ShowMarkers
指示是否突出显示 sparkline 组中每条线 sparkline 中的每个点。
public bool ShowMarkers { get; set; }
属性值
ShowNegativePoints
指示是否用不同的颜色或标记突出显示 sparkline 组中的负值。
public bool ShowNegativePoints { get; set; }
属性值
Sparklines
获取 Aspose.Cells.Charts.Sparkline 对象的集合。
public SparklineCollection Sparklines { get; }
属性值
Type
指示 sparkline 组的 sparkline 类型。
public SparklineType Type { get; set; }
属性值
VerticalAxisMaxValue
获取和设置垂直轴的自定义最大值。
public double VerticalAxisMaxValue { get; set; }
属性值
VerticalAxisMaxValueType
表示垂直轴最大值类型。
public SparklineAxisMinMaxType VerticalAxisMaxValueType { get; set; }
属性值
VerticalAxisMinValue
获取和设置垂直轴的自定义最小值。
public double VerticalAxisMinValue { get; set; }
属性值
VerticalAxisMinValueType
表示垂直轴最小值类型。
public SparklineAxisMinMaxType VerticalAxisMinValueType { get; set; }
属性值
方法
ResetRanges(string, bool, CellArea)
重置 sparkline 组的数据范围和位置范围。
此方法将清除组中原有的 sparkline 项,并为新范围创建新的 sparkline 项。
public void ResetRanges(string dataRange, bool isVertical, CellArea locationRange)
参数
dataRange
string
指定 sparkline 组的新数据范围。
isVertical
bool
指定是否按行或按列从新数据范围绘制 sparkline。
locationRange
CellArea
指定 sparkline 的放置位置。