/** * @file XTPChartBarSeriesStyle.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(__XTPCHARTBARSERIESSTYLE_H__) # define __XTPCHARTBARSERIESSTYLE_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartSeriesView; /** * @brief * This class represents a bar series style for the chart, which is a kind of * CXTPChartSeriesStyle. * * @details * A bar chart or bar graph is a chart with rectangular bars with lengths * proportional to the values that they represent. Bar charts are used for * comparing two or more values that were taken over time or on different * conditions, usually on small data sets. */ class _XTP_EXT_CLASS CXTPChartBarSeriesStyle : public CXTPChartDiagram2DSeriesStyle { /** @cond */ DECLARE_SERIAL(CXTPChartBarSeriesStyle) /** @endcond */ public: /** * @brief * Constructs a CXTPChartBarSeriesStyle object. */ CXTPChartBarSeriesStyle(); /** * @brief * Destroys a CXTPChartBarSeriesStyle object, handles cleanup. */ virtual ~CXTPChartBarSeriesStyle(); public: void DoPropExchange(CXTPPropExchange* pPX); public: /** * @brief * Call this function to get the width of the bar. * * @return * A double value specifying the width of the bar. */ double GetBarWidth() const; /** * @brief * Call this function to set the width of the bar. * * @param dWidth A double value specifying the width of the bar. */ void SetBarWidth(double dWidth); CXTPChartFillStyle* GetFillStyle() const; CXTPChartBorder* GetBorder() const; BOOL IsSideBySide() const; void SetSideBySide(BOOL bSideBySide); int GetBarDistanceFixed() const; void SetBarDistanceFixed(int nBarDistanceFixed); protected: /** * @brief * Call this function to create the view of the bar series. * * @param pSeries A pointer to the chart series object, to which this object * is associated with. * @param pDiagramView A pointer to the chart diagram view object, to which this object * is associated with. * * @return * A pointer to CXTPChartSeriesView. Refers to the newly created * CXTPChartBarSeriesView object. */ virtual CXTPChartSeriesView* CreateView(CXTPChartSeries* pSeries, CXTPChartDiagramView* pDiagramView); /** * @brief * Call this function to correct the axis side margins. * * @param pAxis A pointer to the chart axis object, to which this object * is associated with. * @param nMinValue A double specifying the minimum value. * @param nMaxValue A double specifying the maximum value. * @param nCorrection A reference to a double object, which specifies the correction * applied. */ virtual void CorrectAxisSideMargins(CXTPChartAxis* pAxis, double nMinValue, double nMaxValue, double& nCorrection); protected: double m_dBarWidth; // The width of the bar. CXTPChartFillStyle* m_pFillStyle; CXTPChartBorder* m_pBorder; BOOL m_bSideBySide; int m_nBarDistanceFixed; # ifdef _XTP_ACTIVEX public: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPChartBarSeriesStyle); DECLARE_OLECREATE_EX(CXTPChartBarSeriesStyle) LPDISPATCH OleGetFillStyle(); LPDISPATCH OleGetBorder(); /** @endcond */ # endif }; AFX_INLINE double CXTPChartBarSeriesStyle::GetBarWidth() const { return m_dBarWidth; } AFX_INLINE void CXTPChartBarSeriesStyle::SetBarWidth(double dWidth) { m_dBarWidth = dWidth; OnChartChanged(); } AFX_INLINE CXTPChartFillStyle* CXTPChartBarSeriesStyle::GetFillStyle() const { return m_pFillStyle; } AFX_INLINE CXTPChartBorder* CXTPChartBarSeriesStyle::GetBorder() const { return m_pBorder; } AFX_INLINE void CXTPChartBarSeriesStyle::SetSideBySide(BOOL bSideBySide) { m_bSideBySide = bSideBySide; OnChartChanged(); } AFX_INLINE BOOL CXTPChartBarSeriesStyle::IsSideBySide() const { return m_bSideBySide; } AFX_INLINE int CXTPChartBarSeriesStyle::GetBarDistanceFixed() const { return m_nBarDistanceFixed; } AFX_INLINE void CXTPChartBarSeriesStyle::SetBarDistanceFixed(int nBarDistanceFixed) { m_nBarDistanceFixed = nBarDistanceFixed; OnChartChanged(); } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTBARSERIESSTYLE_H__) /** @endcond */