/** * @file XTPChartPieSeriesViewBase.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(__XTPCHARTPIESERIESVIEWBASE_H__) # define __XTPCHARTPIESERIESVIEWBASE_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * This class abstracts the view of a pie series. This class is a kind of * CXTPChartSeriesView. * * @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 CXTPChartPieSeriesViewBase : public CXTPChartSeriesView { protected: /** * @brief * Constructs a CXTPChartPieSeriesViewBase object. * * @param pSeries Pointer to pie series object. * @param pDiagramView Pointer to the pie diagram view. */ CXTPChartPieSeriesViewBase(CXTPChartSeries* pSeries, CXTPChartDiagramView* pDiagramView); public: /** * @brief * Destroys a CXTPChartPieSeriesViewBase object, handle cleanup. */ virtual ~CXTPChartPieSeriesViewBase(); public: /** * @brief * Call this function to calculate the pie series point layout. * * @param pDC Pointer to the chart device context. * @param rcBounds The rectangular boundary. */ virtual void CalculatePointLayout(CXTPChartDeviceContext* pDC, CRect rcBounds) = 0; /** * @brief * Call this function to calculate the pie series label layout. * * @param pDC Pointer to the chart device context. */ virtual void CalculateLabelLayout(CXTPChartDeviceContext* pDC); /** * @brief * Call this function to create the pie diagram domain object associated * with this object. * * @param rcBounds The rectangular boundary of the diagram. * @param pDC Pointer to the chart device context. * * @return * A pointer to the chart diagram domain object. */ virtual CXTPChartDiagramDomain* CreateDiagramDomain(CXTPChartDeviceContext* pDC, CRect rcBounds); /** * @brief * Call this function to get the inner bounds of the diagram. * * @return * A chart rect object denoting the rectangular boundary. */ CXTPChartRectF GetInnerBounds() const; /** * @brief * Use this function to get the pie diagram domain object associated with * this object. * * @return * A pointer to the chart diagram domain object. */ CXTPChartDiagramDomain* GetDomain() const; /** * @brief * Obtains maximum allowed label width. * * @return * Maximum allowed label width. */ int GetMaxLabelWidth() const; protected: /** * @brief * Use this function to create the pie series point view object. * * @param pDC Pointer to chart device context. * @param pPoint Pointer to chart series point. * @param pParentView Parent view pointer. * * @return * A pointer to the chart series point view. */ virtual CXTPChartSeriesPointView* CreateSeriesPointView(CXTPChartDeviceContext* pDC, CXTPChartSeriesPoint* pPoint, CXTPChartElementView* pParentView) = 0; /** * @brief * This function creates a CXTPChartDeviceCommand object. This object * represents the rendering of the pie series. * * @param pDC Pointer to a CXTPChartDeviceContext object. * * @return * Returns a CXTPChartDeviceCommand object. This object handles * the rendering of an element in the chart. Here it handles * the drawing of the pie series. */ virtual CXTPChartDeviceCommand* CreateDeviceCommand(CXTPChartDeviceContext* pDC) = 0; /** * @brief * This function creates a label view drawing command object. * * @param pDC Pointer to a CXTPChartDeviceContext object. * @param rcBounds The rectangular boundary of the legend. * * @return * Returns a new label view drawing command object. */ virtual CXTPChartDeviceCommand* CreateLegendDeviceCommand(CXTPChartDeviceContext* pDC, CRect rcBounds) = 0; /** @cond */ virtual void CalculateValues(); /** @endcond */ protected: CXTPChartDiagramDomain* m_pDomain; // Pointer to the diagram domain. int m_nMaxLabelWidth; }; AFX_INLINE CXTPChartDiagramDomain* CXTPChartPieSeriesViewBase::GetDomain() const { return m_pDomain; } AFX_INLINE int CXTPChartPieSeriesViewBase::GetMaxLabelWidth() const { return m_nMaxLabelWidth; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTPIESERIESVIEWBASE_H__) /** @endcond */