/** * @file XTPChartErrorBar.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(__XTPCHARTERRORBAR_H__) # define __XTPCHARTERRORBAR_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartLineStyle; class _XTP_EXT_CLASS CXTPChartErrorBar : public CXTPChartElement { /** @cond */ DECLARE_SERIAL(CXTPChartErrorBar) /** @endcond */ public: /** * @brief * Constructs a CXTPChartErrorBar object. */ CXTPChartErrorBar(); /** * @brief * Destroys a CXTPChartErrorBar object, handles cleanup. */ virtual ~CXTPChartErrorBar(); public: virtual CXTPChartElementView* CreateView(CXTPChartDeviceContext* pDC, CXTPChartSeriesPointView* pPointView, CXTPChartElementView* pParentView); BOOL IsVisible() const; void SetVisible(BOOL bVisible); XTPChartErrorBarEndStyle GetEndStyle() const; void SetEndStyle(XTPChartErrorBarEndStyle endStyle); XTPChartErrorBarType GetType() const; void SetType(XTPChartErrorBarType type); XTPChartErrorBarDirection GetDirection() const; void SetDirection(XTPChartErrorBarDirection direction); double GetAmount() const; void SetAmount(double dAmount); double GetValuePlus() const; void SetValuePlus(double dValuePlus); double GetValueMinus() const; void SetValueMinus(double dValueMinus); CXTPChartLineStyle* GetLineStyle() const; void SetLineStyle(CXTPChartLineStyle* pLineStyle); CXTPChartColor GetLineColor() const; void SetLineColor(CXTPChartColor clrLine); public: XTPChartErrorBarPosition GetPosition() const; private: BOOL m_bVisible; XTPChartErrorBarEndStyle m_endStyle; XTPChartErrorBarType m_type; XTPChartErrorBarDirection m_direction; int m_nCapLength; double m_dAmount; double m_dValuePlus; /**< For custom error bar*/ double m_dValueMinus; /**< For custom error bar*/ CXTPChartLineStyle* m_pLineStyle; CXTPChartColor m_clrLine; protected: friend class CXTPChartSeriesStyle; friend class CXTPChartErrorBarView; # ifdef _XTP_ACTIVEX public: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPChartErrorBar); LPDISPATCH OleGetLineStyle(); OLE_COLOR OleGetLineColor(); void OleSetLineColor(OLE_COLOR clr); /** @endcond */ # endif }; AFX_INLINE BOOL CXTPChartErrorBar::IsVisible() const { return m_bVisible; } AFX_INLINE void CXTPChartErrorBar::SetVisible(BOOL bVisible) { m_bVisible = bVisible; OnChartChanged(); } AFX_INLINE XTPChartErrorBarType CXTPChartErrorBar::GetType() const { return m_type; } AFX_INLINE void CXTPChartErrorBar::SetType(XTPChartErrorBarType type) { m_type = type; OnChartChanged(); } AFX_INLINE XTPChartErrorBarEndStyle CXTPChartErrorBar::GetEndStyle() const { return m_endStyle; } AFX_INLINE void CXTPChartErrorBar::SetEndStyle(XTPChartErrorBarEndStyle endStyle) { m_endStyle = endStyle; OnChartChanged(); } AFX_INLINE XTPChartErrorBarDirection CXTPChartErrorBar::GetDirection() const { return m_direction; } AFX_INLINE void CXTPChartErrorBar::SetDirection(XTPChartErrorBarDirection direction) { m_direction = direction; } AFX_INLINE double CXTPChartErrorBar::GetAmount() const { return m_dAmount; } AFX_INLINE void CXTPChartErrorBar::SetAmount(double dAmount) { m_dAmount = dAmount; } AFX_INLINE double CXTPChartErrorBar::GetValuePlus() const { return m_dValuePlus; } AFX_INLINE void CXTPChartErrorBar::SetValuePlus(double dValuePlus) { m_dValuePlus = dValuePlus; } AFX_INLINE double CXTPChartErrorBar::GetValueMinus() const { return m_dValueMinus; } AFX_INLINE void CXTPChartErrorBar::SetValueMinus(double dValueMinus) { m_dValueMinus = dValueMinus; } AFX_INLINE CXTPChartLineStyle* CXTPChartErrorBar::GetLineStyle() const { return m_pLineStyle; } AFX_INLINE void CXTPChartErrorBar::SetLineStyle(CXTPChartLineStyle* pLineStyle) { m_pLineStyle = pLineStyle; } AFX_INLINE CXTPChartColor CXTPChartErrorBar::GetLineColor() const { return m_clrLine; } AFX_INLINE void CXTPChartErrorBar::SetLineColor(CXTPChartColor clrLine) { m_clrLine = clrLine; } class _XTP_EXT_CLASS CXTPChartErrorBarView : public CXTPChartElementView { public: CXTPChartErrorBarView(CXTPChartErrorBar* pErrorBar, CXTPChartSeriesPointView* pPointView, CXTPChartElementView* pParentView); void GetValues(double& dCenter, double& dPlus, double& dMinus) const; protected: virtual CXTPChartDeviceCommand* CreateDeviceCommand(CXTPChartDeviceContext* pDC); /** * @brief * Returns the anchor angle of the error bar. */ virtual double GetAnchorAngle(XTPChartErrorBarPosition position) const; protected: CXTPChartErrorBar* m_pErrorBar; CXTPChartSeriesPointView* m_pPointView; }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTERRORBAR_H__) /** @endcond */