/** * @file XTPChartRadarDiagram.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(__XTPCHARTRADARDIAGRAM_H__) # define __XTPCHARTRADARDIAGRAM_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartAxis; class CXTPChartRadarDiagramAppearance; class CXTPChartDiagram2DAppearance; class CXTPChartFillStyle; /** * @brief * Radar diagram style. */ enum XTPChartRadarDiagramStyle { xtpChartRadarDiagramCircle, /**< A circular radar diagram style */ xtpChartRadarDiagramPolygon /**< A polygonal radar diagram style */ }; /** * @brief * This class represents a chart 2D diagram, which is a kind of CXTPChartDiagram. */ class _XTP_EXT_CLASS CXTPChartRadarDiagram : public CXTPChartDiagram { /** @cond */ DECLARE_SERIAL(CXTPChartRadarDiagram) /** @endcond */ public: /** * @brief * Constructs a CXTPChartRadarDiagram object. */ CXTPChartRadarDiagram(); /** * @brief * Destroys a CXTPChartRadarDiagram object, handles cleanup. */ virtual ~CXTPChartRadarDiagram(); public: /** * @brief * Call this function to get the X axis associated with the 2D diagram. * * @return A pointer to a CXTPChartAxis object, the specific type is CXTPChartAxisX. */ CXTPChartAxis* GetAxisX() const; /** * @brief * Call this function to get the Y axis associated with the 2D diagram. * * @return A pointer to a CXTPChartAxis object, the specific type is CXTPChartAxisY. */ CXTPChartAxis* GetAxisY() const; /** * @brief * Call this function to get the diagram appearance object associated * with this object. * * @return A pointer to a CXTPChartRadarDiagramAppearance object. */ CXTPChartDiagram2DAppearance* GetAppearance() const; CXTPChartFillStyle* GetFillStyle() const; CXTPChartColor GetBorderColor() const; CXTPChartColor GetActualBackgroundColor() const; CXTPChartColor GetActualBackgroundColor2() const; CXTPChartColor GetActualBorderColor() const; CXTPChartFillStyle* GetActualFillStyle() const; CXTPChartColor GetBackgroundColor() const; CXTPChartColor GetBackgroundColor2() const; void SetBackgroundColor(const CXTPChartColor& color); void SetBackgroundColor2(const CXTPChartColor& color); void SetBorderColor(const CXTPChartColor& color); int GetStartAngle() const; void SetStartAngle(int nAngle); void SetStyle(XTPChartRadarDiagramStyle style); XTPChartRadarDiagramStyle GetStyle() const; public: /** * @brief * Call this function to create the view of the 2D diagram object. * * @param pDC A pointer to a chart device context object. * @param pParent A pointer to the parent view. * * @return A pointer to a CXTPChartDiagramView object. */ virtual CXTPChartDiagramView* CreateView(CXTPChartDeviceContext* pDC, CXTPChartElementView* pParent); public: void DoPropExchange(CXTPPropExchange* pPX); protected: /** * @brief * Call this function to update the layout if there are some changes in * the diagram. * * @param pDC A pointer to a chart device context object. * @param pView A pointer to the associated diagram view object. * @param rcBounds The rectangular diagram boundary. */ void UpdateLayout(CXTPChartDeviceContext* pDC, CXTPChartDiagramView* pView, CRect rcBounds); # ifdef _XTP_ACTIVEX public: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPChartRadarDiagram); DECLARE_OLECREATE_EX(CXTPChartRadarDiagram) LPDISPATCH OleGetAxisX(); LPDISPATCH OleGetAxisY(); OLE_COLOR OleGetBackgroundColor(); void OleSetBackgroundColor(OLE_COLOR clr); OLE_COLOR OleGetBackgroundColor2(); void OleSetBackgroundColor2(OLE_COLOR clr); OLE_COLOR OleGetBorderColor(); void OleSetBorderColor(OLE_COLOR clr); LPDISPATCH OleGetBackgroundFillStyle(); /** @endcond */ # endif protected: CXTPChartAxis* m_pAxisX; /**< The pointer to X axis object.*/ CXTPChartAxis* m_pAxisY; /**< The pointer to Y axis object.*/ CXTPChartFillStyle* m_pFillStyle; CXTPChartColor m_clrBackgroundColor; CXTPChartColor m_clrBackgroundColor2; CXTPChartColor m_clrBorderColor; int m_nStartAngle; XTPChartRadarDiagramStyle m_nStyle; friend class CXTPChartRadarDiagramView; }; AFX_INLINE CXTPChartAxis* CXTPChartRadarDiagram::GetAxisX() const { return m_pAxisX; } AFX_INLINE CXTPChartAxis* CXTPChartRadarDiagram::GetAxisY() const { return m_pAxisY; } AFX_INLINE CXTPChartFillStyle* CXTPChartRadarDiagram::GetFillStyle() const { return m_pFillStyle; } AFX_INLINE void CXTPChartRadarDiagram::SetBackgroundColor(const CXTPChartColor& color) { m_clrBackgroundColor = color; OnChartChanged(xtpChartUpdateRedraw); } AFX_INLINE void CXTPChartRadarDiagram::SetBackgroundColor2(const CXTPChartColor& color) { m_clrBackgroundColor2 = color; OnChartChanged(xtpChartUpdateRedraw); } AFX_INLINE void CXTPChartRadarDiagram::SetBorderColor(const CXTPChartColor& color) { m_clrBorderColor = color; OnChartChanged(xtpChartUpdateRedraw); } AFX_INLINE int CXTPChartRadarDiagram::GetStartAngle() const { return m_nStartAngle; } AFX_INLINE void CXTPChartRadarDiagram::SetStartAngle(int nAngle) { m_nStartAngle = nAngle; OnChartChanged(); } AFX_INLINE void CXTPChartRadarDiagram::SetStyle(XTPChartRadarDiagramStyle style) { m_nStyle = style; OnChartChanged(); } AFX_INLINE XTPChartRadarDiagramStyle CXTPChartRadarDiagram::GetStyle() const { return m_nStyle; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTRADARDIAGRAM_H__) /** @endcond */