Mobile API Reference  MicroStrategy 2019
PlotManager.h
Go to the documentation of this file.
1 //====================================================================
2 // Filename: PlotManager.h
3 // AUTHOR : Xin Liu
4 // CREATION : 12/04/08
5 // Copyright (C) MicroStrategy, Inc. 2008
6 //==============================================================================================
7 
8 #ifndef MSICHART_PLOTMANAGER_H
9 #define MSICHART_PLOTMANAGER_H
10 #include "../Dataset.h"
11 #include "Legend.h"
12 
13 #include "GraphObjectManager.h"
14 #include "CategoryPlot.h"
15 
16 namespace MsiChart
17 {
18 
23  {
25  : mUseChartArea(false)
26  , mChartAreaNumber(1)
28  {}
29 
33  std::vector<double> mVecPercentageHeightOrWidth;
34  std::vector<std::vector<Int32> > mSeriesDistribution;
35  std::vector<std::vector<Int32> > mGroupDistribution;
36  };
37 
38 
44  {
45  public:
47 
48  PlotManager(const TripleId& irTripleId, GraphObjectManager* ipManager, const Rect2D& irPlotArea);
49  virtual ~PlotManager();
50 
51  //Re-implemention the virtual functions inherited from GraphObjectManager
52  //virtual GraphObject::Ptr OnPointDetection(const Point2D& irCursor) const;
53  //virtual void OnRectangleSelection(const Rect2D& irRect, std::vector<GraphObject::Ptr>& iorSelectedObjects) const;
54  //virtual void Draw();
55  //virtual void GenerateImageMap(ImageMap& iorImageMap);
56  //virtual void GenerateMapAndList();
57  virtual void GetOptions(Int32 iSeriesId, Int32 iPropertyId, CComVariant* opValue) const;
58 
63  void SetDataset(Dataset::Ptr iDataSetPtr);
64 
69  void SetLegend(Legend::Ptr iLegendPtr);
70 
76  void CalculateChartAreas(const Rect2D& irDataArea, std::vector<Rect2D>& orChartAreas);
77 
87  virtual bool GetToolTipData(Int32 iSeriesID, Int32 iGroupID, double& orValue, double& orPercentValue, Int32 iOffset = 0);
88 
89  void SetMarginInfo(Int32 iLeftMargin, Int32 iRightMargin, Int32 iTopMargin, Int32 iBottomMargin);
90 
91  virtual Int32 GetDataAreaSplitX() const;
92 
99  virtual void OnZooming(Int32 iOldStart, Int32 iOldEnd, Int32 iNewStart, Int32 iNewEnd, bool iIsVertical);
100  void GetPlotArea(Rect2D& orRect);
101 
102  protected:
103 
107  void LoadProperties();
108 
116  bool RectangleIntersection(const Rect2D& irRectA, const Rect2D& irRectB, Rect2D& orRect) const;
117 
124  void RectangleUnion(const Rect2D& irRectA, const Rect2D& irRectB, Rect2D& orRect) const;
125 
126 
127  Int32 FindChartAreaIdBySeriesId(Int32 iSeriesId) const;
128 
135 
140  };
141 }
142 
143 #endif
void SetLegend(Legend::Ptr iLegendPtr)
void SetDataset(Dataset::Ptr iDataSetPtr)
Int32 mGraphType
The graph type.
Definition: PlotManager.h:131
void GetPlotArea(Rect2D &orRect)
Int32 mTopMargin
Definition: PlotManager.h:138
Int32 mLeftMargin
Definition: PlotManager.h:136
Definition: Dataset.h:198
bool mRecalculateFrame
Indicates whether the frame should be recalculated and repositioned.
Definition: PlotManager.h:134
MSynch::SmartPtr< PlotManager > Ptr
Definition: PlotManager.h:46
Dataset::Ptr mDatasetPtr
The pointer to Dataset.
Definition: PlotManager.h:130
virtual void OnZooming(Int32 iOldStart, Int32 iOldEnd, Int32 iNewStart, Int32 iNewEnd, bool iIsVertical)
Legend::Ptr mLegendPtr
The pointer to Legend.
Definition: PlotManager.h:129
EnumOrientation mOrientation
Chart areas orientation.
Definition: PlotManager.h:32
#define Int32
Definition: BasicTypes.h:20
std::vector< std::vector< Int32 > > mGroupDistribution
Group distribution of all groups.
Definition: PlotManager.h:35
bool RectangleIntersection(const Rect2D &irRectA, const Rect2D &irRectB, Rect2D &orRect) const
bool mUseChartArea
Indicates whether Chart Areas is enabled or not.
Definition: PlotManager.h:30
PlotManager(const TripleId &irTripleId, GraphObjectManager *ipManager, const Rect2D &irPlotArea)
virtual Int32 GetDataAreaSplitX() const
Rect2D mPlotArea
The whole plot area.
Definition: PlotManager.h:132
std::vector< std::vector< Int32 > > mSeriesDistribution
Series distribution of all series.
Definition: PlotManager.h:34
void SetMarginInfo(Int32 iLeftMargin, Int32 iRightMargin, Int32 iTopMargin, Int32 iBottomMargin)
virtual bool GetToolTipData(Int32 iSeriesID, Int32 iGroupID, double &orValue, double &orPercentValue, Int32 iOffset=0)
Definition: SmartPtr.h:38
void CalculateChartAreas(const Rect2D &irDataArea, std::vector< Rect2D > &orChartAreas)
EnumOrientation
Definition: CategoryPlot.h:21
Int32 FindChartAreaIdBySeriesId(Int32 iSeriesId) const
Definition: ABLPlot.h:21
Definition: PlotManager.h:22
Int32 mRightMargin
Definition: PlotManager.h:137
virtual void GetOptions(Int32 iSeriesId, Int32 iPropertyId, CComVariant *opValue) const
Definition: Msi_ccomvariant.h:24
void RectangleUnion(const Rect2D &irRectA, const Rect2D &irRectB, Rect2D &orRect) const
Int32 mChartAreaNumber
Chart areas count.
Definition: PlotManager.h:31
ChartAreaOptions()
Definition: PlotManager.h:24
ChartAreaOptions mChartAreaOptions
The chart areas option.
Definition: PlotManager.h:133
Definition: GraphObjectManager.h:37
Definition: CategoryPlot.h:24
Use four Int32 values to represent a 2D rectangle.
Definition: Rect2D.h:25
Definition: PlotManager.h:43
std::vector< double > mVecPercentageHeightOrWidth
Space division of chart areas.
Definition: PlotManager.h:33
Definition: Common.h:397
Int32 mBottomMargin
Definition: PlotManager.h:139