|
OpenXLSX 1.9.1
|
#include <XLChart.hpp>
Public Member Functions | |
| XLChart () | |
| Constructor. | |
| XLChart (XLXmlData *xmlData) | |
| Constructor from XLXmlData. | |
| XLChart (const XLChart &other)=default | |
| Copy Constructor. | |
| XLChart (XLChart &&other) noexcept=default | |
| Move Constructor. | |
| ~XLChart ()=default | |
| Destructor. | |
| XLChart & | operator= (const XLChart &other)=default |
| Copy Assignment Operator. | |
| XLChart & | operator= (XLChart &&other) noexcept=default |
| Move Assignment Operator. | |
| XLChartSeries | addSeries (const XLWorksheet &wks, const XLCellRange &values, std::string_view title="", std::optional< XLChartType > targetChartType=std::nullopt, bool useSecondaryAxis=false) |
| Add a data series to the chart. | |
| XLChartSeries | addSeries (const XLWorksheet &wks, const XLCellRange &values, const XLCellRange &categories, std::string_view title="", std::optional< XLChartType > targetChartType=std::nullopt, bool useSecondaryAxis=false) |
| XLChartSeries | addSeries (std::string_view valuesRef, std::string_view title="", std::string_view categoriesRef="", std::optional< XLChartType > targetChartType=std::nullopt, bool useSecondaryAxis=false) |
| XLChartSeries | addBubbleSeries (std::string_view xValRef, std::string_view yValRef, std::string_view sizeRef, std::string_view title="") |
| Add a bubble chart series with explicit X, Y, and size ranges. | |
| XLChartSeries | addBubbleSeries (const XLWorksheet &wks, const XLCellRange &xValues, const XLCellRange &yValues, const XLCellRange &sizes, std::string_view title="") |
| void | setTitle (std::string_view title) |
| Set the chart title. | |
| void | setStyle (uint8_t styleId) |
| Set the built-in chart style ID (1–48). | |
| void | setLegendPosition (XLLegendPosition position) |
| Set the legend position or hide it. | |
| XLAxis | xAxis () const |
| Get the X-axis (typically bottom category axis). | |
| XLAxis | yAxis () const |
| Get the Y-axis (typically left value axis). | |
| XLAxis | axis (std::string_view position) const |
| void | setShowDataLabels (bool showValue, bool showCategory=false, bool showPercent=false) |
| Configure the display of data labels on the chart. | |
| void | setSeriesSmooth (uint32_t seriesIndex, bool smooth) |
| Set whether a specific series should be rendered with a smooth line. | |
| void | setSeriesMarker (uint32_t seriesIndex, XLMarkerStyle style) |
| Set the marker style for a specific series. | |
| void | setGapWidth (uint32_t percent) |
| Set the gap width between bar/column clusters. | |
| void | setOverlap (int32_t percent) |
| Set the overlap between bars/columns within a cluster. | |
| void | setHoleSize (uint8_t percent) |
| Set the size of the hole in a doughnut chart. | |
| void | setRotation (uint16_t x, uint16_t y, uint16_t perspective=30) |
| Set the rotation of a 3D chart. | |
| void | setPlotAreaColor (std::string_view hexRGB) |
| Fill the chart plot area with a solid color. | |
| void | setChartAreaColor (std::string_view hexRGB) |
| Fill the outermost chart space background with a solid color. | |
Public Member Functions inherited from OpenXLSX::XLXmlFile | |
| XLXmlFile ()=default | |
| Default constructor. | |
| std::string | xmlData (XLXmlSavingDeclaration savingDeclaration=XLXmlSavingDeclaration{}) const |
| Method for getting the XML data represented by the object. | |
| XLXmlFile (XLXmlData *xmlData) | |
| Constructor. Creates an object based on the xmlData input. | |
| XLXmlFile (const XLXmlFile &other)=default | |
| Copy constructor. Default implementation used. | |
| XLXmlFile (XLXmlFile &&other) noexcept=default | |
| Move constructor. Default implementation used. | |
| ~XLXmlFile ()=default | |
| Destructor. Default implementation used. | |
| bool | valid () const |
| check whether class is linked to a valid XML file | |
| XLXmlFile & | operator= (const XLXmlFile &other)=default |
| The copy assignment operator. The default implementation has been used. | |
| XLXmlFile & | operator= (XLXmlFile &&other) noexcept=default |
| The move assignment operator. The default implementation has been used. | |
| XLDocument & | parentDoc () |
| This function provides access to the parent XLDocument object. | |
| const XLDocument & | parentDoc () const |
| This function provides access to the parent XLDocument object. | |
| XMLDocument & | xmlDocument () |
| This function provides access to the underlying XMLDocument object. | |
| const XMLDocument & | xmlDocument () const |
| This function provides access to the underlying XMLDocument object. | |
| std::string | getXmlPath () const |
| Retrieve the path of the XML data in the .xlsx zip archive via m_xmlData->getXmlPath. | |
Friends | |
| class | XLDocument |
Additional Inherited Members | |
Protected Member Functions inherited from OpenXLSX::XLXmlFile | |
| void | setXmlData (std::string_view xmlData) |
| Provide the XML data represented by the object. | |
| std::string | relationshipID () const |
| This function returns the relationship ID (the ID used in the XLRelationships objects) for the object. | |
Protected Attributes inherited from OpenXLSX::XLXmlFile | |
| XLXmlData * | m_xmlData {nullptr} |
|
inline |
Constructor.
|
explicit |
Constructor from XLXmlData.
| xmlData | the source XML data |
|
default |
Copy Constructor.
| other | The object to be copied |
|
defaultnoexcept |
Move Constructor.
|
default |
Destructor.
| XLChartSeries OpenXLSX::XLChart::addBubbleSeries | ( | const XLWorksheet & | wks, |
| const XLCellRange & | xValues, | ||
| const XLCellRange & | yValues, | ||
| const XLCellRange & | sizes, | ||
| std::string_view | title = "" |
||
| ) |
| XLChartSeries OpenXLSX::XLChart::addBubbleSeries | ( | std::string_view | xValRef, |
| std::string_view | yValRef, | ||
| std::string_view | sizeRef, | ||
| std::string_view | title = "" |
||
| ) |
Add a bubble chart series with explicit X, Y, and size ranges.
| xValRef | Cell reference for X values (e.g. "Sheet1!$A$2:$A$10"). |
| yValRef | Cell reference for Y values. |
| sizeRef | Cell reference for bubble sizes. |
| title | Optional series name. |
| XLChartSeries OpenXLSX::XLChart::addSeries | ( | const XLWorksheet & | wks, |
| const XLCellRange & | values, | ||
| const XLCellRange & | categories, | ||
| std::string_view | title = "", |
||
| std::optional< XLChartType > | targetChartType = std::nullopt, |
||
| bool | useSecondaryAxis = false |
||
| ) |
| XLChartSeries OpenXLSX::XLChart::addSeries | ( | const XLWorksheet & | wks, |
| const XLCellRange & | values, | ||
| std::string_view | title = "", |
||
| std::optional< XLChartType > | targetChartType = std::nullopt, |
||
| bool | useSecondaryAxis = false |
||
| ) |
Add a data series to the chart.
| valuesRef | A cell reference to the data values (e.g. "Sheet1!$B$1:$B$10") |
| title | A literal string or cell reference for the series name. |
| categoriesRef | A cell reference for the X-axis categories. |
| XLChartSeries OpenXLSX::XLChart::addSeries | ( | std::string_view | valuesRef, |
| std::string_view | title = "", |
||
| std::string_view | categoriesRef = "", |
||
| std::optional< XLChartType > | targetChartType = std::nullopt, |
||
| bool | useSecondaryAxis = false |
||
| ) |
| XLAxis OpenXLSX::XLChart::axis | ( | std::string_view | position | ) | const |
Move Assignment Operator.
| void OpenXLSX::XLChart::setChartAreaColor | ( | std::string_view | hexRGB | ) |
Fill the outermost chart space background with a solid color.
| hexRGB | Six-character hex color. |
| void OpenXLSX::XLChart::setGapWidth | ( | uint32_t | percent | ) |
Set the gap width between bar/column clusters.
| percent | Gap expressed as a percentage of bar width (0–500, default 150). |
| void OpenXLSX::XLChart::setHoleSize | ( | uint8_t | percent | ) |
Set the size of the hole in a doughnut chart.
| percent | Hole size as a percentage of the chart diameter (1–90, default 75). |
| void OpenXLSX::XLChart::setLegendPosition | ( | XLLegendPosition | position | ) |
Set the legend position or hide it.
| void OpenXLSX::XLChart::setOverlap | ( | int32_t | percent | ) |
Set the overlap between bars/columns within a cluster.
| percent | Overlap in percent (−100 to 100). Positive = overlap, negative = gap. |
| void OpenXLSX::XLChart::setPlotAreaColor | ( | std::string_view | hexRGB | ) |
Fill the chart plot area with a solid color.
| hexRGB | Six-character hex color, e.g. "F2F2F2". |
| void OpenXLSX::XLChart::setRotation | ( | uint16_t | x, |
| uint16_t | y, | ||
| uint16_t | perspective = 30 |
||
| ) |
Set the rotation of a 3D chart.
| x | Rotation around the X-axis in degrees (0–90). |
| y | Rotation around the Y-axis in degrees (0–360). |
| perspective | Perspective value (0–100, default 30). |
| void OpenXLSX::XLChart::setSeriesMarker | ( | uint32_t | seriesIndex, |
| XLMarkerStyle | style | ||
| ) |
Set the marker style for a specific series.
| void OpenXLSX::XLChart::setSeriesSmooth | ( | uint32_t | seriesIndex, |
| bool | smooth | ||
| ) |
Set whether a specific series should be rendered with a smooth line.
| void OpenXLSX::XLChart::setShowDataLabels | ( | bool | showValue, |
| bool | showCategory = false, |
||
| bool | showPercent = false |
||
| ) |
Configure the display of data labels on the chart.
| void OpenXLSX::XLChart::setStyle | ( | uint8_t | styleId | ) |
Set the built-in chart style ID (1–48).
| void OpenXLSX::XLChart::setTitle | ( | std::string_view | title | ) |
Set the chart title.
| XLAxis OpenXLSX::XLChart::xAxis | ( | ) | const |
Get the X-axis (typically bottom category axis).
| XLAxis OpenXLSX::XLChart::yAxis | ( | ) | const |
Get the Y-axis (typically left value axis).
|
friend |