OpenXLSX 1.9.1
Loading...
Searching...
No Matches
OpenXLSX::XLChartSeries Class Reference

#include <XLChart.hpp>

Public Member Functions

 XLChartSeries ()=default
 
 XLChartSeries (const XMLNode &node)
 
XLChartSeriessetTitle (std::string_view title)
 
XLChartSeriessetSmooth (bool smooth)
 
XLChartSeriessetMarkerStyle (XLMarkerStyle style)
 
XLChartSeriessetColor (std::string_view hexRGB)
 Set the fill and line color of this data series.
 
XLChartSeriessetDataPointColor (uint32_t pointIdx, std::string_view hexRGB)
 Override the color of a single data point within this series.
 
XLChartSeriessetDataLabels (bool showValue, bool showCategoryName=false, bool showPercent=false)
 Enable and configure data labels for this series.
 
XLChartSeriessetDataLabelsFromRange (const XLWorksheet &wks, const XLCellRange &range)
 Set the data labels for this series to come from a worksheet range.
 
XLChartSeriesaddTrendline (XLTrendlineType type, std::string_view name="", uint8_t order=2, uint8_t period=2)
 Add a trendline to this series.
 
XLChartSeriesaddErrorBars (XLErrorBarDirection direction, XLErrorBarType type, XLErrorBarValueType valType, double value=0.0)
 Add error bars to this series.
 

Constructor & Destructor Documentation

◆ XLChartSeries() [1/2]

OpenXLSX::XLChartSeries::XLChartSeries ( )
default

◆ XLChartSeries() [2/2]

OpenXLSX::XLChartSeries::XLChartSeries ( const XMLNode node)
explicit

Member Function Documentation

◆ addErrorBars()

XLChartSeries & OpenXLSX::XLChartSeries::addErrorBars ( XLErrorBarDirection  direction,
XLErrorBarType  type,
XLErrorBarValueType  valType,
double  value = 0.0 
)

Add error bars to this series.

◆ addTrendline()

XLChartSeries & OpenXLSX::XLChartSeries::addTrendline ( XLTrendlineType  type,
std::string_view  name = "",
uint8_t  order = 2,
uint8_t  period = 2 
)

Add a trendline to this series.

◆ setColor()

XLChartSeries & OpenXLSX::XLChartSeries::setColor ( std::string_view  hexRGB)

Set the fill and line color of this data series.

Parameters
hexRGBSix-character hex color string, e.g. "FF0000" for red.

◆ setDataLabels()

XLChartSeries & OpenXLSX::XLChartSeries::setDataLabels ( bool  showValue,
bool  showCategoryName = false,
bool  showPercent = false 
)

Enable and configure data labels for this series.

Parameters
showValueShow the cell value on each label.
showCategoryNameShow the category name.
showPercentShow percentage (mainly for pie/doughnut charts).

◆ setDataLabelsFromRange()

XLChartSeries & OpenXLSX::XLChartSeries::setDataLabelsFromRange ( const XLWorksheet wks,
const XLCellRange range 
)

Set the data labels for this series to come from a worksheet range.

Parameters
wksThe worksheet containing the labels.
rangeThe range of cells to use for labels.

◆ setDataPointColor()

XLChartSeries & OpenXLSX::XLChartSeries::setDataPointColor ( uint32_t  pointIdx,
std::string_view  hexRGB 
)

Override the color of a single data point within this series.

Parameters
pointIdxZero-based index of the data point.
hexRGBSix-character hex color string.

◆ setMarkerStyle()

XLChartSeries & OpenXLSX::XLChartSeries::setMarkerStyle ( XLMarkerStyle  style)

◆ setSmooth()

XLChartSeries & OpenXLSX::XLChartSeries::setSmooth ( bool  smooth)

◆ setTitle()

XLChartSeries & OpenXLSX::XLChartSeries::setTitle ( std::string_view  title)

The documentation for this class was generated from the following file: