SimpleXlsx  r0.19
 All Classes Namespaces Functions Variables Enumerations Pages
SimpleXlsx::CChartsheet Class Reference

The class CChartsheet is used for creation sheet with a number of charts. More...

#include <Chartsheet.h>

Classes

struct  Axis
 Structure that describes axis properties. More...
struct  Diagramm
 Structure describes diagramm properties. More...
struct  Series
 Structure to setup a chart. More...

Public Types

enum  EPosition
 General property.
enum  EGridLines
 Axis grid detalization property.
enum  ETableData
 The enumeration contains values that determine diagramm diagram data table property.
enum  EAxisCross
 The enumeration contains values that demermine point where axis will pass through.
enum  EBarDirection
 The enumeration determines bars` direction in bar diagramm.
enum  EBarGrouping
 The enumeration determinese several bar relative position.
enum  EScatterStyle
 The enumeration determines scatter diagram styles.

Public Member Functions

 CChartsheet ()
 The class default constructor.
 CChartsheet (uint32_t index, const _tstring &temp_path)
 The class constructor.
 CChartsheet (uint32_t index, EChartTypes type, const _tstring &temp_path)
 The class constructor.
virtual ~CChartsheet ()
 The class destructor (virtual)
bool AddSeries (const Series &series, bool mainChart=true)
 Adds specified series into chartsheet.
bool Save ()
 For each chart it creates and saves 5 files: chartXX.xml, sheetXX.xml, sheetXX.xml.rels, drawingXX.xml, drawingXX.xml.rels.

Private Member Functions

void Init (uint32_t index, EChartTypes type)
 Initializes internal variables and creates the core structure of a sheet tree.
void AddTitle (const TCHAR *name, uint32_t size, bool vertPos)
 This internal method adds title section into xml object.
void AddTableData ()
 Adds table data into chart if it is necessary.
void AddLegend ()
 Adds legend into chart if it is necessary.
void AddXAxis (const Axis &x, uint32_t crossAxisId=0)
 Internal method adds X axis block into chart.
void AddYAxis (const Axis &y, uint32_t crossAxisId=0)
 Internal method adds Y axis block into chart.
void AddLineChart (Axis &xAxis, uint32_t yAxisId, const std::vector< Series > &series, uint32_t firstSeriesId)
 Adds line chart xml section.
void AddBarChart (Axis &xAxis, uint32_t yAxisId, const std::vector< Series > &series, uint32_t firstSeriesId, EBarDirection barDir, EBarGrouping barGroup)
 Adds bar chart xml section.
void AddScatterChart (uint32_t xAxisId, uint32_t yAxisId, const std::vector< Series > &series, uint32_t firstSeriesId, EScatterStyle style)
 Adds scatter chart xml section.

Private Attributes

_tofstream * m_f
 file stream for xml stream
xmlw::XmlStream * m_xmlStream
 xml output stream
int32_t m_index
 chart ID number
_tstring m_temp_path
 path to the temporary directory (unique for a book)
_tstring m_title
 chart sheet title
bool m_isOk
 initialization status
std::vector< Seriesm_seriesSet
 series set for main chart type
std::vector< Seriesm_seriesSetAdd
 series set for additional chart type
Diagramm m_diagramm
 diagram object
Axis m_xAxis
 main X axis object
Axis m_yAxis
 main Y axis object
Axis m_x2Axis
 additional X axis object
Axis m_y2Axis
 additional Y axis object

Detailed Description

The class CChartsheet is used for creation sheet with a number of charts.

See Also
EChartTypes supplying types of charts
Note
All created chartsheets inside workbook will be allocated on its` own sheet

Constructor & Destructor Documentation

SimpleXlsx::CChartsheet::CChartsheet ( )

The class default constructor.

Returns
no
SimpleXlsx::CChartsheet::CChartsheet ( uint32_t  index,
const _tstring &  temp_path 
)

The class constructor.

Parameters
indexindex of a sheet to be created (for example, chart1.xml)
temp_pathpath to the temporary directory where chart files must be created
Returns
no
SimpleXlsx::CChartsheet::CChartsheet ( uint32_t  index,
EChartTypes  type,
const _tstring &  temp_path 
)

The class constructor.

Parameters
indexindex of a sheet to be created (for example, chart1.xml)
typechart type (BAR or LINEAR)
temp_pathpath to the temporary directory where chart files must be created
Returns
no
SimpleXlsx::CChartsheet::~CChartsheet ( )
virtual

The class destructor (virtual)

Returns
no

Member Function Documentation

void SimpleXlsx::CChartsheet::AddBarChart ( Axis xAxis,
uint32_t  yAxisId,
const std::vector< Series > &  series,
uint32_t  firstSeriesId,
EBarDirection  barDir,
EBarGrouping  barGroup 
)
private

Adds bar chart xml section.

Parameters
xAxisreference to axis object
yAxisIdid of using y axis
seriesreference to the vector of line sets
firstSeriesIdis used for synchronization between different line charts
barDirbarsdirection (horizontal or vertical) @param barGroup bars relative position
See Also
EBarDirection
EBarGrouping
Returns
no
void SimpleXlsx::CChartsheet::AddLegend ( )
private

Adds legend into chart if it is necessary.

Returns
no
void SimpleXlsx::CChartsheet::AddLineChart ( Axis xAxis,
uint32_t  yAxisId,
const std::vector< Series > &  series,
uint32_t  firstSeriesId 
)
private

Adds line chart xml section.

Parameters
xAxisreference to axis object
yAxisIdid of using y axis
seriesreference to the vector of line sets
firstSeriesIdis used for synchronization between different line charts
Returns
no
void SimpleXlsx::CChartsheet::AddScatterChart ( uint32_t  xAxisId,
uint32_t  yAxisId,
const std::vector< Series > &  series,
uint32_t  firstSeriesId,
EScatterStyle  style 
)
private

Adds scatter chart xml section.

Parameters
xAxisIdid of using x axis
yAxisIdid of using y axis
seriesreference to the vector of line sets
firstSeriesIdis used for synchronization between different line charts
styledetermines diagramm style
See Also
EScatterStyle
Returns
no
bool SimpleXlsx::CChartsheet::AddSeries ( const Series series,
bool  mainChart = true 
)

Adds specified series into chartsheet.

Parameters
seriesreference to series object to be added
mainChartindicates whether series must be added into main chart or additional (main by default)
Returns
Boolean result of the oepration
void SimpleXlsx::CChartsheet::AddTableData ( )
private

Adds table data into chart if it is necessary.

Returns
no
void SimpleXlsx::CChartsheet::AddTitle ( const TCHAR *  name,
uint32_t  size,
bool  vertPos 
)
private

This internal method adds title section into xml object.

Parameters
nameTitle value
sizeFont size
vertPosindicates whether the title is allocated on X axis (false) or vertical (true)
Returns
no
void SimpleXlsx::CChartsheet::AddXAxis ( const Axis x,
uint32_t  crossAxisId = 0 
)
private

Internal method adds X axis block into chart.

Parameters
xreference to an axis object
crossAxisIdid of axis that is used in pair with setting
Returns
no
void SimpleXlsx::CChartsheet::AddYAxis ( const Axis y,
uint32_t  crossAxisId = 0 
)
private

Internal method adds Y axis block into chart.

Parameters
yreference to an axis object
crossAxisIdid of axis that is used in pair with setting
Returns
no
void SimpleXlsx::CChartsheet::Init ( uint32_t  index,
EChartTypes  type 
)
private

Initializes internal variables and creates the core structure of a sheet tree.

Parameters
indexindex of a sheet to be created (for example, chart1.xml)
typechart type (BAR or LINEAR)
Returns
no
bool SimpleXlsx::CChartsheet::Save ( )

For each chart it creates and saves 5 files: chartXX.xml, sheetXX.xml, sheetXX.xml.rels, drawingXX.xml, drawingXX.xml.rels.

Returns
Boolean result of the operation

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