Mobile API Reference  MicroStrategy 2019
ChartManager.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : ChartManager.h
3 // AUTHOR : Xin Liu
4 // CREATION : 5/22/08
5 // Copyright (C) MicroStrategy, Inc. 2008
6 //==============================================================================================
7 
8 #ifndef MSICHART_CHARTMANAGER_H
9 #define MSICHART_CHARTMANAGER_H
10 
11 #include "PDCHeader/PDCvector"
12 #include "../Dataset.h"
13 #include "GraphObjectManager.h"
14 #include "Plot.h"
15 #include "PlotManager.h"
16 #include "Legend.h"
17 #include "TextObject.h"
18 
19 
20 
21 namespace MsiChart
22 {
24  const Int32 gDefaultMargin = 10;
25 
33  {
34  public:
36 
37  ChartManager(const TripleId& iTripleId, Dataset::Ptr iDatasetPtr, ChartContext::Ptr iChartContextPtr);
38  ~ChartManager();
39 
40  virtual GraphObject::Ptr OnPointDetection(const Point2D& irCursor) const;
41  virtual void OnRectangleSelection(const Rect2D& irRect, std::vector<GraphObject::Ptr>& iorSelectedObjects) const;
42  virtual void GenerateMapAndList();
43  virtual void Draw();
44  virtual void GenerateView();
45  virtual void GenerateImageMap(ImageMap& iorImageMap);
46 
47  virtual void GetOptions(Int32 iPropertyId, CComVariant* opValue) const;
48  virtual void GetOptions(Int32 iSeriesId, Int32 iPropertyId, CComVariant* opValue) const;
49 
58  bool GetToolTipData(Int32 iSeriesID, Int32 iGroupID, double& orValue, double& orPercentValue, Int32 iOffset);
59  /* obsolete functions
60  void SetGraphType(Int32 iGraphType);
61  void GetGraphType(Int32& orGraphType);
62  */
63 
64  void SetDataset(Dataset::Ptr iDataSetPtr);
65  Int32 GetDataAreaSplitX() const;
66 
73  void OnZooming(Int32 iOldStart, Int32 iOldEnd, Int32 iNewStart, Int32 iNewEnd, bool iIsVertical);
74 
75 
76  //void hCalculatePlotArea();
77 
81  void LoadProperties();
82 
87  void CalculateLayout(Rect2D& iorArea);
88 
94  bool CheckDataset();
95 
101 
102  void SetHighlightLayerObject(LayerObject::Ptr iHighlightLayerObjectPtr);
104 
105 
109  void SetHighlightSelectedObjects(std::vector<std::pair<Int32, Int32> >& iSelectedSeriesAndColumns);
111 
113  void DrawPostGraphObjects();
114 
117  bool GetGroupSpace(std::vector<Int32>& orVect, Int32 iGroupIndex, bool iIsLegend);
118 
119  private:
126  // void hAdjustFrame(Rect2D& iorArea, Int32 iWidthMargin, Int32 iHeightMargin);
127 
128  Int32 mGraphType;
129 
130  std::vector<PlotManager::Ptr> mPlotManagers;
131  Dataset::Ptr mDatasetPtr;
132  Legend::Ptr mLegendPtr;
133  LayerObject::Ptr mHighlightLayerObjectPtr;
134 
135  bool mIsTitleShown;
136  bool mIsSubtitleShown;
137  bool mIsFootnoteShown;
138  bool mIsLegendShown;
139  bool mIsExpanded;
140 
141  bool mIsInitialized;
142 
143  Int32 mLeftMargin;
144  Int32 mRightMargin;
145  Int32 mTopMargin;
146  Int32 mBottomMargin;
147 
148  bool mAxisLabelsAutoFit;
149 
150  std::vector<std::pair<Int32, Int32> > mSelectedSeriesAndColumns;
151 
152  std::vector<GraphObject::Ptr> mPostGraphObjectList;
153 
154  protected:
155  Legend::Ptr hGetLegend(Rect2D& iorArea);
156  };
157 }
158 
159 #endif
virtual GraphObject::Ptr OnPointDetection(const Point2D &irCursor) const
void SetDataset(Dataset::Ptr iDataSetPtr)
virtual void GenerateImageMap(ImageMap &iorImageMap)
void OnZooming(Int32 iOldStart, Int32 iOldEnd, Int32 iNewStart, Int32 iNewEnd, bool iIsVertical)
RectangleObject::Ptr CreateBackground()
const Int32 gDefaultMargin
The default margin value.
Definition: ChartManager.h:24
virtual void GenerateView()
Definition: Dataset.h:198
Legend::Ptr hGetLegend(Rect2D &iorArea)
bool GetToolTipData(Int32 iSeriesID, Int32 iGroupID, double &orValue, double &orPercentValue, Int32 iOffset)
#define Int32
Definition: BasicTypes.h:20
virtual void GetOptions(Int32 iPropertyId, CComVariant *opValue) const
Definition: ChartManager.h:32
void DrawPostGraphObjects()
471270 When there&#39;s curve polygon, need to draw legend and category labels on top layer...
Definition: ChartContext.h:542
virtual void Draw()
virtual void GenerateMapAndList()
Definition: ABLPlot.h:21
void ClearHighlightSelectedObjects()
const Int32 gDefaultMarginForTimeSeries
The default margin value for time series chart.
Definition: ChartManager.h:23
std::vector< AreaRec * > ImageMap
Definition: ImageMap.h:99
Int32 GetDataAreaSplitX() const
void SetHighlightSelectedObjects(std::vector< std::pair< Int32, Int32 > > &iSelectedSeriesAndColumns)
void SetHighlightLayerObject(LayerObject::Ptr iHighlightLayerObjectPtr)
ChartManager(const TripleId &iTripleId, Dataset::Ptr iDatasetPtr, ChartContext::Ptr iChartContextPtr)
bool GetGroupSpace(std::vector< Int32 > &orVect, Int32 iGroupIndex, bool iIsLegend)
Definition: Msi_ccomvariant.h:24
LayerObject::Ptr GetHighlightLayerObject()
virtual void OnRectangleSelection(const Rect2D &irRect, std::vector< GraphObject::Ptr > &iorSelectedObjects) const
Definition: GraphObjectManager.h:37
void CalculateLayout(Rect2D &iorArea)
Use four Int32 values to represent a 2D rectangle.
Definition: Rect2D.h:25
Definition: Common.h:397
MSynch::SmartPtr< ChartManager > Ptr
Definition: ChartManager.h:35