OpenXLSX 1.12.1
Modern C++ Excel Library (Fork of OpenXLSX by Kenneth Troldal Balslev)
Loading...
Searching...
No Matches
XLSparkline.hpp
Go to the documentation of this file.
1/*
2 * OpenXLSX-NX - Modern High-Performance C++ Excel Library
3 *
4 * Original work Copyright (c) 2018-2025, Kenneth Troldal Balslev and OpenXLSX contributors
5 * Modified work Copyright (c) 2026, Curry Tang and OpenXLSX-NX contributors
6 *
7 * Distributed under the BSD 3-Clause License.
8 * See LICENSE.md in the project root or https://opensource.org/licenses/BSD-3-Clause
9 */
10
11#ifndef OPENXLSX_XLSPARKLINE_HPP
12#define OPENXLSX_XLSPARKLINE_HPP
13
14#include "OpenXLSX-Exports.hpp"
15#include "XLXmlFile.hpp"
16#include <string>
17
18namespace OpenXLSX
19{
24
29 {
31 std::string seriesColor {"FF376092"}; // Default blue-ish
32 std::string negativeColor {"FFD00000"}; // Default red
33 std::string markersColor {"FFD00000"};
34 std::string firstMarkerColor {"FFD00000"};
35 std::string lastMarkerColor {"FFD00000"};
36 std::string highMarkerColor {"FFD00000"};
37 std::string lowMarkerColor {"FFD00000"};
38
39 bool markers {false}; // Show markers
40 bool high {false}; // Highlight highest point
41 bool low {false}; // Highlight lowest point
42 bool first {false}; // Highlight first point
43 bool last {false}; // Highlight last point
44 bool negative {false};// Highlight negative points
45 bool displayXAxis {false}; // Show horizontal axis
46 std::string displayEmptyCellsAs {"gap"}; // gap, zero, span
47 };
48
52 class OPENXLSX_EXPORT XLSparkline
53 {
54 public:
56 explicit XLSparkline(XMLNode node);
58
59 XLSparklineType type() const;
61
62 std::string location() const;
63 void setLocation(const std::string& sqref);
64
65 std::string dataRange() const;
66 void setDataRange(const std::string& formula);
67
68 private:
69 XMLNode m_node;
70 };
71
72} // namespace OpenXLSX
73
74#endif // OPENXLSX_XLSPARKLINE_HPP
void setLocation(const std::string &sqref)
Definition XLSparkline.cpp:56
XLSparklineType type() const
Definition XLSparkline.cpp:23
void setType(XLSparklineType type)
Definition XLSparkline.cpp:31
void setDataRange(const std::string &formula)
Definition XLSparkline.cpp:70
std::string dataRange() const
Definition XLSparkline.cpp:63
std::string location() const
Definition XLSparkline.cpp:49
XLSparkline()
Definition XLSparkline.cpp:17
Definition XLFormulaUtils.hpp:37
Definition IXLCellProvider.hpp:24
XLSparklineType
The XLSparklineType enum represents the type of a sparkline.
Definition XLSparkline.hpp:23
@ Stacked
Definition XLSparkline.hpp:23
@ Line
Definition XLSparkline.hpp:23
@ Column
Definition XLChart.hpp:31
@ Line
Definition XLChart.hpp:37
OpenXLSX_xml_node XMLNode
Definition XLXmlParser.hpp:64
The XLSparklineOptions struct encapsulates configuration for a sparkline group.
Definition XLSparkline.hpp:29
bool first
Definition XLSparkline.hpp:42
std::string negativeColor
Definition XLSparkline.hpp:32
bool markers
Definition XLSparkline.hpp:39
bool low
Definition XLSparkline.hpp:41
std::string lastMarkerColor
Definition XLSparkline.hpp:35
std::string firstMarkerColor
Definition XLSparkline.hpp:34
std::string highMarkerColor
Definition XLSparkline.hpp:36
std::string displayEmptyCellsAs
Definition XLSparkline.hpp:46
XLSparklineType type
Definition XLSparkline.hpp:30
std::string lowMarkerColor
Definition XLSparkline.hpp:37
bool last
Definition XLSparkline.hpp:43
bool displayXAxis
Definition XLSparkline.hpp:45
bool high
Definition XLSparkline.hpp:40
std::string markersColor
Definition XLSparkline.hpp:33
bool negative
Definition XLSparkline.hpp:44
std::string seriesColor
Definition XLSparkline.hpp:31