/** * @file XTPChartAxisRange.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(__XTPCHARTAXISRANGE_H__) # define __XTPCHARTAXISRANGE_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartAxis; class CXTPChartAxisView; /** * @brief * This class represents the value range of the axis. * * @details * This class is associated with a chart axis class. */ class _XTP_EXT_CLASS CXTPChartAxisRange : public CXTPChartElement { /** @cond */ DECLARE_DYNAMIC(CXTPChartAxisRange) /** @endcond */ public: /** * @brief * Constructs a CXTPChartAxisRange object. * * @param pAxis Pointer to the associated chart axis object. */ CXTPChartAxisRange(CXTPChartAxis* pAxis); /** * @brief * Destroys a CXTPChartAxisLabel object, handles cleanup. */ virtual ~CXTPChartAxisRange(); public: /** * @brief * This function updates the axis, with respect to the series values. * @param pView Pointer to CXTPChartAxisView * @details * Call this function whenever there is a change in series values. */ void UpdateRange(CXTPChartAxisView* pView); /** * @brief * Call this function to get the maximum value of the axis. * * @return A double value which denotes the maximum value. */ double GetMaxValue() const; /** * @brief * Call this function to get the minimum value of the axis. * * @return A double value which denotes the minimum value. */ double GetMinValue() const; /** * @brief * Call this function to set the maximum value of the axis. * * @param dMaxValue A double value which denotes the maximum value. */ void SetMaxValue(double dMaxValue); /** * @brief * Call this function to set the minimum value of the axis. * * @param dMinValue A double value which denotes the minimum value. */ void SetMinValue(double dMinValue); /** * @brief * Call this function to manually set the min and max values for the range. * * @param bAutoRange TRUE to allow manually set range, FALSE to calculate automatically. */ void SetAutoRange(BOOL bAutoRange); BOOL IsAutoRange() const; ////////////////////////////////////////////////////////////////////////// // View /** * @brief * Call this function to get the maximum value of axis. * * @return A double value which denotes the maximum value. */ double GetViewMaxValue() const; /** * @brief * Call this function to get the minimum value of axis. * * @return A double value which denotes the minimum value. */ double GetViewMinValue() const; /** * @brief * Call this function to set the maximum value of axis. * * @param dMaxValue A double value which denotes the maximum value. */ void SetViewMaxValue(double dMaxValue); /** * @brief * Call this function to set the minimum value of axis. * * @param dMinValue A double value which denotes the minimum value. */ void SetViewMinValue(double dMinValue); /** * @brief * Call this function to manually set the min and max values for the range. * * @param bAutoRange TRUE to allow manually set range, FALSE to calculate automatically. */ void SetViewAutoRange(BOOL bAutoRange); BOOL IsViewAutoRange() const; public: /** * @brief * Call this function to enable or disable the side margins. * * @param bSideMargins A BOOL value. TRUE to enable the side margins, * FALSE to disable the side margins. */ void SetSideMargins(BOOL bSideMargins); /** * @brief * Call this function to check if the side margins are enabled or disabled. * * @return A BOOL value. TRUE if the side margins are enabled, FALSE otherwise. */ BOOL GetSideMargins() const; /** * @brief * Call this function to enable or disable the zero level on the axis. * * @param bShowZeroLevel A BOOL value. TRUE to enable the zero level, * FALSE to disable the zero level. */ void SetShowZeroLevel(BOOL bShowZeroLevel); /** * @brief * Call this function to check if the zero level is enabled or disabled. * * @return A BOOL value. TRUE if the zero level is enabled, FALSE otherwise. */ BOOL GetShowZeroLevel() const; public: double GetZoomLimit() const; void SetZoomLimit(double dZoomLimit); public: void DoPropExchange(CXTPPropExchange* pPX); protected: /** * @brief * This function updates range based on the various parameters affecting * the axis range (e.g. size margins, showing zero level, etc.). * @param pView Pointer to CXTPChartAxisView */ void Correct(CXTPChartAxisView* pView); protected: CXTPChartAxis* m_pAxis; /**< Pointer to chart axis object.*/ double m_nMinValue; /**< The minimum value of the range.*/ double m_nMaxValue; /**< The maximum value of the range.*/ BOOL m_bSideMargins; /**< TRUE if the side margins are present and FALSE if not.*/ BOOL m_bShowZeroLevel; /**< TRUE if the zero level is shown on the axis and FALSE if not.*/ BOOL m_bAutoRange; double m_nViewMinValue; double m_nViewMaxValue; BOOL m_bViewAutoRange; double m_dZoomLimit; # ifdef _XTP_ACTIVEX public: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPChartAxisRange); afx_msg BOOL OleGetShowZeroLevel(); afx_msg void OleSetShowZeroLevel(BOOL bSet); afx_msg BOOL OleGetSideMargins(); afx_msg void OleSetSideMargins(BOOL bSet); afx_msg BOOL OleGetAutoRange(); afx_msg void OleSetAutoRange(BOOL bSet); afx_msg double OleGetMinValue(); afx_msg void OleSetMinValue(double bSet); afx_msg double OleGetMaxValue(); afx_msg void OleSetMaxValue(double bSet); /** @endcond */ # endif friend class CXTPChartAxis; }; AFX_INLINE double CXTPChartAxisRange::GetMaxValue() const { return m_nMaxValue; } AFX_INLINE double CXTPChartAxisRange::GetMinValue() const { return m_nMinValue; } AFX_INLINE BOOL CXTPChartAxisRange::GetSideMargins() const { return m_bSideMargins; } AFX_INLINE BOOL CXTPChartAxisRange::GetShowZeroLevel() const { return m_bShowZeroLevel; } AFX_INLINE BOOL CXTPChartAxisRange::IsAutoRange() const { return m_bAutoRange; } AFX_INLINE double CXTPChartAxisRange::GetViewMaxValue() const { return m_nViewMaxValue; } AFX_INLINE double CXTPChartAxisRange::GetViewMinValue() const { return m_nViewMinValue; } AFX_INLINE BOOL CXTPChartAxisRange::IsViewAutoRange() const { return m_bViewAutoRange; } AFX_INLINE double CXTPChartAxisRange::GetZoomLimit() const { return m_dZoomLimit; } AFX_INLINE void CXTPChartAxisRange::SetZoomLimit(double dZoomLimit) { m_dZoomLimit = dZoomLimit; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTAXISRANGE_H__) /** @endcond */