Aspose::Cells::Charts::SparklineGroup class
Contents
[
Hide
]SparklineGroup class
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.
class SparklineGroup
Methods
| Method | Description |
|---|---|
| GetDisplayHidden() | Indicates whether to show data in hidden rows and columns. |
| GetFirstPointColor() | Gets and sets the color of the first point of data in the sparkline group. |
| GetHighPointColor() | Gets and sets the color of the highest points of data in the sparkline group. |
| GetHorizontalAxisColor() | Gets and sets the color of the horizontal axis in the sparkline group. |
| GetHorizontalAxisDateRange() | Represents the range that contains the date values for the sparkline data. |
| GetLastPointColor() | Gets and sets the color of the last point of data in the sparkline group. |
| GetLineWeight() | Gets and sets the line weight in each line sparkline in the sparkline group, in the unit of points. |
| GetLowPointColor() | Gets and sets the color of the lowest points of data in the sparkline group. |
| GetMarkersColor() | Gets and sets the color of points in each line sparkline in the sparkline group. |
| GetNegativePointsColor() | Gets and sets the color of the negative values on the sparkline group. |
| GetPlotEmptyCellsType() | Indicates how to plot empty cells. |
| GetPlotRightToLeft() | Indicates whether the plot data is right to left. |
| GetPresetStyle() | Gets and sets the preset style type of the sparkline group. |
| GetSeriesColor() | Gets and sets the color of the sparklines in the sparkline group. |
| GetShowFirstPoint() | Indicates whether to highlight the first point of data in the sparkline group. |
| GetShowHighPoint() | Indicates whether to highlight the highest points of data in the sparkline group. |
| GetShowHorizontalAxis() | Indicates whether to show the sparkline horizontal axis. The horizontal axis appears if the sparkline has data that crosses the zero axis. |
| GetShowLastPoint() | Indicates whether to highlight the last point of data in the sparkline group. |
| GetShowLowPoint() | Indicates whether to highlight the lowest points of data in the sparkline group. |
| GetShowMarkers() | Indicates whether to highlight each point in each line sparkline in the sparkline group. |
| GetShowNegativePoints() | Indicates whether to highlight the negative values on the sparkline group with a different color or marker. |
| GetSparklines() | Gets the collection of Sparkline object. |
| GetType() | Indicates the sparkline type of the sparkline group. |
| GetVerticalAxisMaxValue() | Gets and sets the custom maximum value for the vertical axis. |
| GetVerticalAxisMaxValueType() | Represents the vertical axis maximum value type. |
| GetVerticalAxisMinValue() | Gets and sets the custom minimum value for the vertical axis. |
| GetVerticalAxisMinValueType() | Represents the vertical axis minimum value type. |
| IsNull() const | Checks whether the implementation object is nullptr. |
| explicit operator bool() const | operator bool() |
| operator=(const SparklineGroup& src) | operator= |
| ResetRanges(const U16String& dataRange, bool isVertical, const CellArea& locationRange) | 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. |
| ResetRanges(const char16_t* dataRange, bool isVertical, const CellArea& locationRange) | 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. |
| SetDisplayHidden(bool value) | Indicates whether to show data in hidden rows and columns. |
| SetFirstPointColor(const CellsColor& value) | Gets and sets the color of the first point of data in the sparkline group. |
| SetHighPointColor(const CellsColor& value) | Gets and sets the color of the highest points of data in the sparkline group. |
| SetHorizontalAxisColor(const CellsColor& value) | Gets and sets the color of the horizontal axis in the sparkline group. |
| SetHorizontalAxisDateRange(const U16String& value) | Represents the range that contains the date values for the sparkline data. |
| SetHorizontalAxisDateRange(const char16_t* value) | Represents the range that contains the date values for the sparkline data. |
| SetLastPointColor(const CellsColor& value) | Gets and sets the color of the last point of data in the sparkline group. |
| SetLineWeight(double value) | Gets and sets the line weight in each line sparkline in the sparkline group, in the unit of points. |
| SetLowPointColor(const CellsColor& value) | Gets and sets the color of the lowest points of data in the sparkline group. |
| SetMarkersColor(const CellsColor& value) | Gets and sets the color of points in each line sparkline in the sparkline group. |
| SetNegativePointsColor(const CellsColor& value) | Gets and sets the color of the negative values on the sparkline group. |
| SetPlotEmptyCellsType(PlotEmptyCellsType value) | Indicates how to plot empty cells. |
| SetPlotRightToLeft(bool value) | Indicates whether the plot data is right to left. |
| SetPresetStyle(SparklinePresetStyleType value) | Gets and sets the preset style type of the sparkline group. |
| SetSeriesColor(const CellsColor& value) | Gets and sets the color of the sparklines in the sparkline group. |
| SetShowFirstPoint(bool value) | Indicates whether to highlight the first point of data in the sparkline group. |
| SetShowHighPoint(bool value) | Indicates whether to highlight the highest points of data in the sparkline group. |
| SetShowHorizontalAxis(bool value) | Indicates whether to show the sparkline horizontal axis. The horizontal axis appears if the sparkline has data that crosses the zero axis. |
| SetShowLastPoint(bool value) | Indicates whether to highlight the last point of data in the sparkline group. |
| SetShowLowPoint(bool value) | Indicates whether to highlight the lowest points of data in the sparkline group. |
| SetShowMarkers(bool value) | Indicates whether to highlight each point in each line sparkline in the sparkline group. |
| SetShowNegativePoints(bool value) | Indicates whether to highlight the negative values on the sparkline group with a different color or marker. |
| SetType(SparklineType value) | Indicates the sparkline type of the sparkline group. |
| SetVerticalAxisMaxValue(double value) | Gets and sets the custom maximum value for the vertical axis. |
| SetVerticalAxisMaxValueType(SparklineAxisMinMaxType value) | Represents the vertical axis maximum value type. |
| SetVerticalAxisMinValue(double value) | Gets and sets the custom minimum value for the vertical axis. |
| SetVerticalAxisMinValueType(SparklineAxisMinMaxType value) | Represents the vertical axis minimum value type. |
| SparklineGroup(SparklineGroup_Impl* impl) | Constructs from an implementation object. |
| SparklineGroup(const SparklineGroup& src) | Copy constructor. |
| ~SparklineGroup() | Destructor. |
Fields
| Field | Description |
|---|---|
| _impl | The implementation object. |
Examples
Aspose::Cells::Startup();
Workbook book;
Worksheet sheet = book.GetWorksheets().Get(0);
sheet.GetCells().Get(u"A1").PutValue(5);
sheet.GetCells().Get(u"B1").PutValue(2);
sheet.GetCells().Get(u"C1").PutValue(1);
sheet.GetCells().Get(u"D1").PutValue(3);
// Define the CellArea
CellArea ca;
ca.StartColumn = 4;
ca.EndColumn = 4;
ca.StartRow = 0;
ca.EndRow = 0;
int idx = sheet.GetSparklineGroups().Add(SparklineType::Line, u"A1:D1", false, ca);
SparklineGroup group = sheet.GetSparklineGroups().Get(idx);
group.GetSparklines().Add(sheet.GetName() + u"!A1:D1", 0, 4);
// Create CellsColor
CellsColor clr = book.CreateCellsColor();
clr.SetColor(Color{ 0xff, 0xff, 0xa5, 0 });//Orange
group.SetSeriesColor(clr);
// set the high points are colored green and the low points are colored red
group.SetShowHighPoint(true);
group.SetShowLowPoint(true);
group.GetHighPointColor().SetColor(Color{0xff, 0, 0x80, 0});//Green
group.GetLowPointColor().SetColor(Color{0xff, 0xff, 0, 0});//Red
// set line weight
group.SetLineWeight(1.0);
book.Save(u"output.xlsx", SaveFormat::Xlsx);
Aspose::Cells::Cleanup();
See Also
- Namespace Aspose::Cells::Charts
- Library Aspose.Cells for C++