/** * @file XTPChartPieSeriesStyleBase.h * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ /** @cond */ #if !defined(__XTPCHARTPIESERIESSTYLEBASE_H__) # define __XTPCHARTPIESERIESSTYLEBASE_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartSeriesView; class CXTPChartBorder; /** * @brief * This class abstracts the basic style of a pie serie.This class is a kind of * CXTPChartSeriesStyle. * * @details * A pie chart (or a circle graph) is a circular chart divided into sectors, * illustrating percents. In a pie chart, the arc length of each sector (and * consequently its central angle and area), is proportional to the quantity * it represents. Together, the sectors create a full disk. */ class _XTP_EXT_CLASS CXTPChartPieSeriesStyleBase : public CXTPChartSeriesStyle { /** @cond */ DECLARE_DYNAMIC(CXTPChartPieSeriesStyleBase) /** @endcond */ protected: /** * @brief * Constructs a CXTPChartPieSeriesStyleBase object. */ CXTPChartPieSeriesStyleBase(); /** * @brief * Destroys a CXTPChartPieSeriesStyleBase object, handle cleanup. */ virtual ~CXTPChartPieSeriesStyleBase(); public: /** * @brief * Call this function to get the hole percent of the pie chart. * * @return * An integer value specifying the hole percentage. */ int GetHolePercent() const; /** * @brief * Call this function to set the hole percent of the pie chart. * * @param nHolePercent An integer value specifying the hole percentage. */ void SetHolePercent(int nHolePercent); /** * @brief * Call this function to get the exploded distance percent of the pie * chart. * * @return * An integer value specifying the hole percentage. * * @details * A chart with one or more sectors separated from the rest of the disk * is known as an exploded pie chart. */ int GetExplodedDistancePercent() const; /** * @brief * Call this function to set the exploded distance percent of the pie * chart. * * @param nExplodedDistancePercent An integer value specifying the exploded * distance percentage. * * @details * A chart with one or more sectors separated from the rest of the disk * is known as an exploded pie chart. */ void SetExplodedDistancePercent(int nExplodedDistancePercent); /** * @brief * Call this function to get the rotation of the sectors of the pie chart. * * @return * An integer value specifying the rotation angle in degree. */ int GetRotation() const; /** * @brief * Call this function to set the rotation of the sectors of the pie chart. * * @param nRotation An integer value specifying the rotation angle in degree. */ void SetRotation(int nRotation); /** * @brief * Call this function to get the depth of 3D pie chart. * * @return * An integer value specifying the depth of 3D pie chart. */ virtual int GetDepth() const; /** * @brief * Call this member function to Store/Load an event using the * specified data object. * * @param pPX Source or destination CXTPPropExchange data object reference. * * @details * This member function is used to store or load event data to or * from a storage. */ void DoPropExchange(CXTPPropExchange* pPX); /** * @brief * Obtains border object pointer. * * @return * Associated border object pointer. */ CXTPChartBorder* GetBorder() const; /** * @brief * Obtains border color. * * @return * Border color value. */ CXTPChartColor GetBorderActualColor() const; protected: /** * @brief * Call this function to create the pie diagram object. * * @return * A pointer to CXTPChartDiagram object which points to a newly created * CXTPChart2dPieDiagramBase/CXTPChart3dPieDiagramBase object. */ virtual CXTPChartDiagram* CreateDiagram() = 0; /** * @brief * Call this function to create the view of the pie series. * * @param pSeries A pointer to chart series object. * @param pDiagramView A pointer to the diagram view object. * * @return * A pointer to CXTPChartSeriesView object which points to a newly created * CXTPChartPieSeriesViewBase object. */ virtual CXTPChartSeriesView* CreateView(CXTPChartSeries* pSeries, CXTPChartDiagramView* pDiagramView) = 0; /** * @brief * Call this function to check whether chart diagram object passed * is a kind of CXTPChart2dPieDiagramBase/CXTPChart3dPieDiagramBase. * * @param pDiagram A pointer to a chart diagram, whose type is to be identified. * * @return * TRUE if the chart diagram is a pie diagram and FALSE if not. */ virtual BOOL IsStyleDiagram(CXTPChartDiagram* pDiagram) const; protected: # ifdef _XTP_ACTIVEX public: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() afx_msg LPDISPATCH OleGetBorder(); /** @endcond */ # endif protected: int m_nHolePercent; /**< The hole percentage.*/ int m_nExplodedDistancePercent; /**< The exploded distance percentage.*/ int m_nRotation; /**< The sector rotation angle.*/ CXTPChartBorder* m_pBorder; /**< Associated border information.*/ }; AFX_INLINE int CXTPChartPieSeriesStyleBase::GetHolePercent() const { return m_nHolePercent; } AFX_INLINE void CXTPChartPieSeriesStyleBase::SetHolePercent(int nHolePercent) { m_nHolePercent = nHolePercent; OnChartChanged(); } AFX_INLINE int CXTPChartPieSeriesStyleBase::GetExplodedDistancePercent() const { return m_nExplodedDistancePercent; } AFX_INLINE void CXTPChartPieSeriesStyleBase::SetExplodedDistancePercent(int nExplodedDistancePercent) { m_nExplodedDistancePercent = nExplodedDistancePercent; OnChartChanged(); } AFX_INLINE int CXTPChartPieSeriesStyleBase::GetRotation() const { return m_nRotation; } AFX_INLINE void CXTPChartPieSeriesStyleBase::SetRotation(int nRotation) { m_nRotation = nRotation; OnChartChanged(); } AFX_INLINE CXTPChartBorder* CXTPChartPieSeriesStyleBase::GetBorder() const { return m_pBorder; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTPIESERIESSTYLEBASE_H__) /** @endcond */