/** * @file XTPChartDiagram2D.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(__XTPCHARTDIAGRAM2D_H__) # define __XTPCHARTDIAGRAM2D_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartAxis; class CXTPChartDiagram2DPane; class CXTPChartDiagram2DPaneView; class CXTPChartDiagram2DAppearance; typedef CArray CXTPChartAxisArray; enum { xtpChartAxisPrimary = 0, xtpChartAxisSecondary = 1, }; /** * @brief * This class represents a chart 2D diagram, which is a kind of CXTPChartDiagram. */ class _XTP_EXT_CLASS CXTPChartDiagram2D : public CXTPChartDiagram { /** @cond */ DECLARE_SERIAL(CXTPChartDiagram2D) /** @endcond */ public: /** * @brief * Constructs a CXTPChartDiagram2D object. */ CXTPChartDiagram2D(); /** * @brief * Destroys a CXTPChartDiagram2D object, handles cleanup. */ virtual ~CXTPChartDiagram2D(); public: BOOL IsRotated() const; void SetRotated(BOOL bRotated); BOOL IsAllowZoom() const; void SetAllowZoom(BOOL bAllowZoom); BOOL IsAllowScroll() const; void SetAllowScroll(BOOL bAllowScroll); public: int GetAxisCountX() const; int GetAxisCountY() const; void SetAxisCountX(int nAxisCountNewX); void SetAxisCountY(int nAxisCountNewY); CXTPChartAxis* GetAxisX(int nIndex) const; CXTPChartAxis* GetAxisY(int nIndex) const; /** * @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 secondary X axis associated with the 2D * diagram if any. * * @return A pointer to a CXTPChartAxis object. The specific type is CXTPChartAxisX. */ CXTPChartAxis* GetSecondaryAxisX() const; /** * @brief * Call this function to get the secondary Y axis associated with the 2D * diagram if any. * * @return A pointer to a CXTPChartAxis object. The specific type is CXTPChartAxisX. */ CXTPChartAxis* GetSecondaryAxisY() const; /** * @brief * Gets the pane to which this object is associated with. * * @return A pointer to a CXTPChartDiagram2DPane object. */ CXTPChartDiagram2DPane* GetPane() const; /** * @brief * Sets the pane to which this object is associated with. * * @param pPane Pointer to a CXTPChartDiagram2DPane object. */ void SetPane(CXTPChartDiagram2DPane* pPane); /** * @brief * Call this function to get the diagram appearance object associated * with this object. * * @return A pointer to a CXTPChartDiagram2DAppearance object. */ CXTPChartDiagram2DAppearance* GetAppearance() const; public: /** * @brief * Call this function to create the view of a 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(CXTPChartDiagram2D); DECLARE_OLECREATE_EX(CXTPChartDiagram2D) LPDISPATCH OleGetAxisX(); LPDISPATCH OleGetAxisY(); LPDISPATCH OleGetSecondaryAxisX(); LPDISPATCH OleGetSecondaryAxisY(); LPDISPATCH OleGetAxisXByIndex(int nAxisIndex); LPDISPATCH OleGetAxisYByIndex(int nAxisIndex); 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: CXTPChartAxisArray m_arrAxesX; CXTPChartAxisArray m_arrAxesY; CXTPChartDiagram2DPane* m_pPane; /**< The pointer to diagram pane object.*/ BOOL m_bRotated; BOOL m_bAllowZoom; BOOL m_bAllowScroll; friend class CXTPChartDiagram2DView; }; AFX_INLINE CXTPChartDiagram2DPane* CXTPChartDiagram2D::GetPane() const { return m_pPane; } AFX_INLINE BOOL CXTPChartDiagram2D::IsRotated() const { return m_bRotated; } AFX_INLINE void CXTPChartDiagram2D::SetRotated(BOOL bRotated) { m_bRotated = bRotated; OnChartChanged(); } AFX_INLINE BOOL CXTPChartDiagram2D::IsAllowZoom() const { return m_bAllowZoom; } AFX_INLINE void CXTPChartDiagram2D::SetAllowZoom(BOOL bAllowZoom) { m_bAllowZoom = bAllowZoom; } AFX_INLINE BOOL CXTPChartDiagram2D::IsAllowScroll() const { return m_bAllowScroll; } AFX_INLINE void CXTPChartDiagram2D::SetAllowScroll(BOOL bAllowScroll) { m_bAllowScroll = bAllowScroll; OnChartChanged(); } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTDIAGRAM2D_H__) /** @endcond */