Aspose::Cells::Charts::SparklineCollection class
Contents
[
Hide
]SparklineCollection class
Encapsulates a collection of Sparkline objects.
class SparklineCollection
Methods
Method | Description |
---|---|
Add(const U16String& dataRange, int32_t row, int32_t column) | Add a sparkline. |
Add(const char16_t* dataRange, int32_t row, int32_t column) | Add a sparkline. |
Get(int32_t index) | Gets the Sparkline element at the specified index. |
GetCount() | |
IsNull() const | Checks whether the implementation object is nullptr. |
explicit operator bool() const | operator bool() |
operator=(const SparklineCollection& src) | operator= |
Remove(const Aspose::Cells::Object& o) | Removes the sparkline. |
SparklineCollection(SparklineCollection_Impl* impl) | Constructs from an implementation object. |
SparklineCollection(const SparklineCollection& src) | Copy constructor. |
~SparklineCollection() | 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, sheet.GetName() + u"!A1:D1", false, ca);
SparklineGroup group = sheet.GetSparklineGroups().Get(idx);
group.GetSparklines().Add(sheet.GetName() + u"!A1:D1", 0, 4);
book.Save(u"output.xlsx", SaveFormat::Xlsx);
Aspose::Cells::Cleanup();
See Also
- Namespace Aspose::Cells::Charts
- Library Aspose.Cells for C++