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

#include <XLChart.hpp>

Public Member Functions

 XLAxis ()=default
 
 XLAxis (const XMLNode &node)
 
void setTitle (std::string_view title)
 
void setMinBounds (double min)
 
void clearMinBounds ()
 
void setMaxBounds (double max)
 
void clearMaxBounds ()
 
void setMajorUnit (double unit)
 Set the major unit (interval between major tick marks) for the axis.
 
void setMinorUnit (double unit)
 Set the minor unit (interval between minor tick marks) for the axis.
 
void setLogScale (double base)
 Set the axis to use a logarithmic scale.
 
void setDateAxis (bool isDateAxis)
 Convert this axis to a date axis or back to a category axis.
 
void setOrientation (XLAxisOrientation orientation)
 Set the orientation of the axis (normal or reverse).
 
void setCrosses (XLAxisCrosses crosses)
 Set the axis crossing mode.
 
void setCrossesAt (double value)
 Set the axis to cross at a specific value.
 
void setMajorGridlines (bool show)
 
void setMinorGridlines (bool show)
 
void setNumberFormat (std::string_view formatCode, bool sourceLinked=false)
 Set the number format for axis tick labels.
 

Constructor & Destructor Documentation

◆ XLAxis() [1/2]

OpenXLSX::XLAxis::XLAxis ( )
default

◆ XLAxis() [2/2]

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

Member Function Documentation

◆ clearMaxBounds()

void OpenXLSX::XLAxis::clearMaxBounds ( )

◆ clearMinBounds()

void OpenXLSX::XLAxis::clearMinBounds ( )

◆ setCrosses()

void OpenXLSX::XLAxis::setCrosses ( XLAxisCrosses  crosses)

Set the axis crossing mode.

Parameters
crossesXLAxisCrosses::AutoZero, XLAxisCrosses::Min, or XLAxisCrosses::Max.

◆ setCrossesAt()

void OpenXLSX::XLAxis::setCrossesAt ( double  value)

Set the axis to cross at a specific value.

Parameters
valueThe value at which the axis should cross.

◆ setDateAxis()

void OpenXLSX::XLAxis::setDateAxis ( bool  isDateAxis)

Convert this axis to a date axis or back to a category axis.

Parameters
isDateAxisIf true, the axis becomes a c:dateAx. If false, it reverts to c:catAx.

◆ setLogScale()

void OpenXLSX::XLAxis::setLogScale ( double  base)

Set the axis to use a logarithmic scale.

Parameters
baseThe base of the logarithm (e.g. 10). If 0 or less, the logarithmic scale is removed.

◆ setMajorGridlines()

void OpenXLSX::XLAxis::setMajorGridlines ( bool  show)

◆ setMajorUnit()

void OpenXLSX::XLAxis::setMajorUnit ( double  unit)

Set the major unit (interval between major tick marks) for the axis.

Parameters
unitThe unit value.

◆ setMaxBounds()

void OpenXLSX::XLAxis::setMaxBounds ( double  max)

◆ setMinBounds()

void OpenXLSX::XLAxis::setMinBounds ( double  min)

◆ setMinorGridlines()

void OpenXLSX::XLAxis::setMinorGridlines ( bool  show)

◆ setMinorUnit()

void OpenXLSX::XLAxis::setMinorUnit ( double  unit)

Set the minor unit (interval between minor tick marks) for the axis.

Parameters
unitThe unit value.

◆ setNumberFormat()

void OpenXLSX::XLAxis::setNumberFormat ( std::string_view  formatCode,
bool  sourceLinked = false 
)

Set the number format for axis tick labels.

Parameters
formatCodeExcel number format code, e.g. "0.00%" or "#,##0".
sourceLinkedIf true, the format follows the source data format.

◆ setOrientation()

void OpenXLSX::XLAxis::setOrientation ( XLAxisOrientation  orientation)

Set the orientation of the axis (normal or reverse).

Parameters
orientationXLAxisOrientation::MinMax (normal) or XLAxisOrientation::MaxMin (reverse).

◆ setTitle()

void OpenXLSX::XLAxis::setTitle ( std::string_view  title)

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