/** * @file XTPChartBarSeriesLabel.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(__XTPCHARTBARSERIESLABEL_H__) # define __XTPCHARTBARSERIESLABEL_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartSeriesView; enum XTPChartBarLabelPosition { xtpChartBarLabelTop, xtpChartBarLabelCenter }; /** * @brief * This class abstracts the label of a bar series. It is a kind of point * series label. */ class _XTP_EXT_CLASS CXTPChartBarSeriesLabel : public CXTPChartDiagram2DSeriesLabel { DECLARE_SERIAL(CXTPChartBarSeriesLabel); public: /** * @brief * Constructs a CXTPChartBarSeriesLabel object. */ CXTPChartBarSeriesLabel(); /** * @brief * Destroys a CXTPChartBarSeriesLabel object, handles cleanup. */ virtual ~CXTPChartBarSeriesLabel(); public: void SetPosition(XTPChartBarLabelPosition nPosition); XTPChartBarLabelPosition GetPosition() const; public: /** * @brief * This function creates the view of the bar series label. * * @param pDC The device context. * @param pPointView A pointer to the series point view object. * @param pParentView Parent view pointer. * * @return * A pointer to a CXTPChartElementView object, which is polymorphic to * CXTPChartBarSeriesLabelView. */ virtual CXTPChartElementView* CreateView(CXTPChartDeviceContext* pDC, CXTPChartSeriesPointView* pPointView, CXTPChartElementView* pParentView); void DoPropExchange(CXTPPropExchange* pPX); protected: XTPChartBarLabelPosition m_nPosition; # ifdef _XTP_ACTIVEX public: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() DECLARE_OLETYPELIB_EX(CXTPChartBarSeriesLabel); /** @endcond */ # endif }; /** * @brief * This class abstracts the view of the label of a bar series. It is a kind of point * series label view. */ class _XTP_EXT_CLASS CXTPChartBarSeriesLabelView : public CXTPChartDiagram2DSeriesLabelView { public: /** * @brief * Constructs a CXTPChartBarSeriesLabel object. * * @param pLabel Pointer chart series label. * @param pPointView Pointer to chart series point view. * @param pParentView Parent view pointer. */ CXTPChartBarSeriesLabelView(CXTPChartSeriesLabel* pLabel, CXTPChartSeriesPointView* pPointView, CXTPChartElementView* pParentView); /** * @brief * This function calculates the anchor point of the label stem. * * @return A CXTPChartPointF object denoting the anchor point. */ virtual CXTPChartPointF GetAnchorPoint() const; virtual double GetAnchorAngle() const; using CXTPChartDiagram2DSeriesLabelView::CreateDeviceCommand; virtual CXTPChartDeviceCommand* CreateDeviceCommand(CXTPChartDeviceContext* pDC); void CalculateLayout(CXTPChartDeviceContext* pDC); }; AFX_INLINE void CXTPChartBarSeriesLabel::SetPosition(XTPChartBarLabelPosition nPosition) { m_nPosition = nPosition; OnChartChanged(); } AFX_INLINE XTPChartBarLabelPosition CXTPChartBarSeriesLabel::GetPosition() const { return m_nPosition; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTBARSERIESLABEL_H__) /** @endcond */