/** * @file XTPChartSeriesStyle.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(__XTPCHARTSERIESSTYLE_H__) # define __XTPCHARTSERIESSTYLE_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartDiagram; class CXTPChartSeriesLabel; class CXTPChartSeriesView; class CXTPChartSeries; class CXTPChartDiagramView; class CXTPChartAxis; class CXTPChartSeriesStyleAppearance; class CXTPChartErrorBar; class CXTPChartDeviceCommand; /** * @brief * CXTPChartSeriesStyle is a CXTPChartElement derived class. It is the * base class for all Styles for the Chart. */ class _XTP_EXT_CLASS CXTPChartSeriesStyle : public CXTPChartElement { DECLARE_DYNAMIC(CXTPChartSeriesStyle); public: /** * @brief * Constructs a CXTPChartSeriesStyle object. */ CXTPChartSeriesStyle(); /** * @brief * Destroys a CXTPChartSeriesStyle object, handles cleanup. */ virtual ~CXTPChartSeriesStyle(); public: /** * @brief * Call this method to gets the series label object. * * @return * Pointer to CXTPChartSeriesLabel that contains the properties for the label. */ virtual CXTPChartSeriesLabel* GetLabel() const; /** * @brief * Call this method to sets the series label object. * * @param pLabel A new label object to set. * * @return * Pointer to CXTPChartSeriesLabel that contains the properties for the label. */ virtual CXTPChartSeriesLabel* SetLabel(CXTPChartSeriesLabel* pLabel); /** * @brief * Call this method to gets the error bar object. * * @return * Pointer to CXTPChartErrorBar that contains the properties for the error bar. */ virtual CXTPChartErrorBar* GetErrorBar() const; /** * @brief * Call this method to sets the error bar object. * * @param pErrorBar A pointer to a new error bar object to set. * * @return * Pointer to CXTPChartErrorBar that contains the properties for the error bar. */ virtual CXTPChartErrorBar* SetErrorBar(CXTPChartErrorBar* pErrorBar); /** * @brief * Implementations can override this method to customize the creation of * a diagram object. * * @return * New diagram object that will contain the series. */ virtual CXTPChartDiagram* CreateDiagram(); /** * @brief * Implementations should override this method to customize the logic of * checking diagram compatibility with the chart style. By default, * all diagrams are deemed incompatible, i.e. return FALSE. * * @param pDiagram Diagram to check. * * @return * TRUE if the series can be inserted in the diagram object. */ virtual BOOL IsStyleDiagram(CXTPChartDiagram* pDiagram) const; /** * @brief * Call this method to get the color of the series. * * @return * The color of the series. If default appearance color is used, then * CXTPChartColor::Empty will be returned. */ virtual CXTPChartColor GetColor() const; /** * @brief * Call this method to set the color of the series. * * @param clr New Color to be set. It can be CXTPChartColor::Empty to use the * default appearance color. */ virtual void SetColor(CXTPChartColor clr); /** * @brief * Call this method to set individual color for each point of the series. * * @param bColorEach TRUE if individual color should be used for each point of the series. */ virtual void SetColorEach(BOOL bColorEach); /** * @brief * This method is called to check if individual color is used for * each point of the series. * @return True if color is used */ virtual BOOL IsColorEach() const; /** * @brief * Obtains rotation parameters for 3D chart. * * @return * Rotation parameters for 3D chart. * * @see * Set3dRotation */ virtual CXTPChart3dRotation Get3dRotation() const; /** * @brief * Sets rotation parameters for 3D chart. * * @param rotation Rotation parameters in degrees. * * @see * GetRotation */ virtual void Set3dRotation(const CXTPChart3dRotation& rotation); /** * @brief * Sets rotation parameters for 3D chart. * * @param dYaw Yaw angle value in degrees. * @param dPitch Pitch angle value in degrees. * @param dRoll Roll angle value in degrees. * * @see * GetRotation */ virtual void Set3dRotation(double dYaw, double dPitch, double dRoll); /** * @brief * Enables/disables 3D edge smoothing. * * @return * TRUE if edge smoothing is enabled, FALSE otherwise. */ virtual BOOL Is3dEdgeSmoothingEnabled() const; /** * @brief * Enables/disables 3D edge smoothing. * * @param bEnable TRUE to enable 3D edge smoothing, FALSE to disable 3D edge smoothing. */ virtual void Enable3dEdgeSmoothing(BOOL bEnable = TRUE); /** * @brief * Call this function to gets the transparency of the chart if it is * supported by the chart type. * * @return * An integer value denoting the transparency of the chart with a range from 0-255. */ virtual int GetTransparency() const; /** * @brief * Call this function to sets the transparency of the chart if it is * supported by the chart type. * * @param nTransparency An integer value denoting the transparency of the chart with * a range from 0-255. */ virtual void SetTransparency(int nTransparency); /** * @brief * Provides default implementation for axis side margins correction. * * @param pAxis Axis pointer. * @param nMinValue Minimal acceptable value. * @param nMaxValue Maximal acceptable value. * @param nCorrection Result new correction value. */ virtual void CorrectAxisSideMargins(CXTPChartAxis* pAxis, double nMinValue, double nMaxValue, double& nCorrection); /** * @brief * Obtains associated style appearance pointer. * * @return * Style appearance pointer */ virtual CXTPChartSeriesStyleAppearance* GetStyleAppearance() const; /** * @brief * Applies the style to the command provided in case the command * needs style specific details for correct drawing. * * @param pCommand Command pointer for which the style is to be applied. */ virtual void ApplyTo(CXTPChartDeviceCommand* pCommand); /** * @brief * Obtains the index of a point element for which an internal value * can be otained. * * @return * The index of a point element for which an internal value * can be otained */ virtual int GetSeriesPointValueIndex() const; /** * @brief * Reads this object from or writes this object to an archive. * * @param pPX A CXTPPropExchange object to serialize to or from. */ virtual void DoPropExchange(CXTPPropExchange* pPX); /** * @brief * This virtual method is called to create a new view associated with the current style. * * @param pSeries Series associated with the style. * @param pDiagramView Parent diagram view. * * @return * Pointer to a new CXTPChartSeriesView object. */ virtual CXTPChartSeriesView* CreateView(CXTPChartSeries* pSeries, CXTPChartDiagramView* pDiagramView) = 0; # ifdef _XTP_ACTIVEX public: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPChartSeriesStyle); afx_msg void OleChartChanged(); afx_msg LPDISPATCH OleGetLabel(); afx_msg LPDISPATCH OleGetErrorBar(); afx_msg BOOL OleGetColorEach(); afx_msg void OleSetColorEach(BOOL bColorEach); afx_msg OLE_COLOR OleGetColor(); afx_msg void OleSetColor(OLE_COLOR clr); afx_msg LPDISPATCH OleGet3dRotation(); afx_msg void OleSet3dRotation(LPDISPATCH pRotationDisp); /** @endcond */ # endif protected: friend class CXTPChartSeries; CXTPChartSeriesLabel* m_pLabel; /**< Label object*/ CXTPChartErrorBar* m_pErrorBar; /**< Error bar object*/ CXTPChartColor m_clrColor; /**< Custom color of series*/ BOOL m_bColorEach; /**< TRUE to color each point.*/ int m_nTransparency; /**< The transparency value in the range 0..255.*/ CXTPChart3dRotation m_Rotation3d; /**< 3D rotation*/ BOOL m_bSmooth3dEdges; /**< 3D edge smoothing*/ }; AFX_INLINE CXTPChartDiagram* CXTPChartSeriesStyle::CreateDiagram() { return NULL; } AFX_INLINE CXTPChartSeriesLabel* CXTPChartSeriesStyle::GetLabel() const { return m_pLabel; } AFX_INLINE CXTPChartErrorBar* CXTPChartSeriesStyle::GetErrorBar() const { return m_pErrorBar; } AFX_INLINE CXTPChartColor CXTPChartSeriesStyle::GetColor() const { return m_clrColor; } AFX_INLINE void CXTPChartSeriesStyle::SetColor(CXTPChartColor clr) { m_clrColor = clr; OnChartChanged(); } AFX_INLINE BOOL CXTPChartSeriesStyle::IsColorEach() const { return m_bColorEach; } AFX_INLINE void CXTPChartSeriesStyle::SetColorEach(BOOL bColorEach) { m_bColorEach = bColorEach; OnChartChanged(); } AFX_INLINE CXTPChart3dRotation CXTPChartSeriesStyle::Get3dRotation() const { return m_Rotation3d; } AFX_INLINE void CXTPChartSeriesStyle::Set3dRotation(double dYaw, double dPitch, double dRoll) { Set3dRotation(CXTPChart3dRotation(dYaw, dPitch, dRoll)); } AFX_INLINE void CXTPChartSeriesStyle::Set3dRotation(const CXTPChart3dRotation& rotation) { m_Rotation3d = rotation; OnChartChanged(); } AFX_INLINE BOOL CXTPChartSeriesStyle::Is3dEdgeSmoothingEnabled() const { return m_bSmooth3dEdges; } AFX_INLINE void CXTPChartSeriesStyle::Enable3dEdgeSmoothing(BOOL bEnable /*= TRUE*/) { m_bSmooth3dEdges = bEnable; OnChartChanged(); } AFX_INLINE int CXTPChartSeriesStyle::GetTransparency() const { return m_nTransparency; } AFX_INLINE void CXTPChartSeriesStyle::SetTransparency(int nTransparency) { _ASSERTE("Transparency value must be within range [0..255]" && 0 <= nTransparency && nTransparency <= 255); m_nTransparency = nTransparency; OnChartChanged(); } AFX_INLINE int CXTPChartSeriesStyle::GetSeriesPointValueIndex() const { return 0; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTSERIESSTYLE_H__) /** @endcond */