Mobile API Reference  MicroStrategy 2019
PiePlotRenderer.h
Go to the documentation of this file.
1 //
2 // GMPiePlot.h
3 // IPhoneChart
4 //
5 // Created by dong shi on 2/24/12.
6 // Copyright (c) 2012 __MyCompanyName__. All rights reserved.
7 //
8 
9 //GMPiePlot is used to generate the pie chart specific for Graph Matrix. --Stone. 2012-2-24
10 #ifndef MsiChart_GMPiePlot_h
11 #define MsiChart_GMPiePlot_h
12 
13 #include "Axis.h"
14 #include "PieSliceObject.h"
15 #include "DataLabelManager.h"
16 #include "PiePlot.h"
17 
18 using namespace MsiChart;
19 
20 struct PieOption
21 {
23  {
24  mLayout = PL_PIE;
25  mRingFactor = 70;
26  mScale = 1.0;
27  mDepthInChart = 0;
28  mPieRotation = 90;
29  }
30  EnumPieLayout mLayout; //Pie or Ring
31  Int32 mRingFactor; //Percentage of Ring's Inner Radius;
33  double mScale;
36 };
37 
39 {
40 public:
42 
43  PiePlotRenderer(GraphObjectManager* ipManager, Dataset::Ptr iDatasetPtr, ChartContext::Ptr irChartContextPtr, EnumGraphMatrixPiePlotType iPlotType, Int32 iMaxRadius = -1);
44  virtual ~PiePlotRenderer();
45 
46  std::vector<GraphObject::Ptr > hDrawSinglePie(Int32 iGroupId, Int32 iSeriesId, Int32 iAngleIndex, const Point2D& iCenter);
47 
48  void EnableDataLabel();
49 
50  void GetDataLableVecs(std::vector<GraphObject::Ptr>& iorLables);
51  virtual void AddObjectsToDataLabelManager(DataLabelManager::Ptr iDataLabelManagerPtr);
52 protected:
53 
54  PieSliceObject::Ptr hCreateSlice(Int32 iSeriesIndex, Int32 iGroupId, Int32 iAngleIndex, Int32 iSliceId, const Point2D& iCenter, Int32 iStartAngle, Int32 iEndAngle, bool iIsOneSeries);
55 
56  bool hGetAngleInfoForSinglePie(Int32 iGroupId, Int32 iSeriesId, Int32 iAngleIndex, Int32& orValidSeriesNumber, std::vector<Int32>& orValidSeriesIndex, std::vector<Int32>& orAngles);
57 
58  double hGetTotal(Int32 iGroupIndex, Int32 iSeriesId, EnumGraphMatrixDataIndexType iDataIndexType, Int32 iAngleIndex);
59 
60  Int32 hGetPieRadius(Int32 iGroupId, Int32 iSeriesId, Int32 iAngleIndex);
61  double hGetMaxSizeByGroupTotal();
62  double hGetMinSizeByGroupTotal();
63 
64 private:
65 
66  //--------------Data Label in GM-----------------//
67  TextObject::Ptr hCreateAndPutDLforSlice(const PieSliceObject* ipSlice);
68  DataLabelManager::Ptr hInitDataLabelManager();
69  GMDataLabelVecs mDataLabelVec;
70  bool mIsShowValue;
71 
72  GraphObjectManager* mpManager;
73  Dataset::Ptr mDatasetPtr;
74  ChartContext::Ptr mChartContextPtr;
75  bool mIsVertical;
76  bool mIsDegressiveSize;
77  bool mIsAngled;
78  bool mIsSliceDropzoneHasTemplateMetric;
79  bool mIsColorbyDropzoneHasTemplateMetric;
80  bool mIsXDropzoneHasTemplateMetric;
81  bool mIsYDropzoneHasTemplateMetric;
82  bool mIsRowOrColzoneHasTemplateMetric;
83 
84  Int32 mSeriesSectionCount;
85  Int32 mDataPositionPartSize;
86  Int32 mDataSizeByPartSize;
87  Int32 mSeriesCount;
88  Int32 mSizeByIndex;
89  Int32 mMaxPieRadius;
90  Int32 mSeriesSectionStartAngel;
91  double mSeriesSectionSubtotal;
92 
93  bool hUpdateSpecificColor(const TripleId& irId, GraphObject::Ptr lPtr);
94 
95  PieOption mPieOption;
97 
98  double mMinSizeByTotal;
99  double mMaxSizeByTotal;
100 
101  void hInitMaxRadius();
102 
103  void hInit();
104 
105 };
106 
107 #endif
Int32 mMaxRadius
Definition: PiePlotRenderer.h:32
double mScale
Definition: PiePlotRenderer.h:33
Definition: PieSliceObject.h:74
Definition: Dataset.h:198
PieOption()
Definition: PiePlotRenderer.h:22
#define Int32
Definition: BasicTypes.h:20
Definition: PiePlot.h:24
EnumPieLayout mLayout
Definition: PiePlotRenderer.h:30
Definition: PiePlotRenderer.h:20
Definition: ChartContext.h:542
Int32 mRingFactor
Definition: PiePlotRenderer.h:31
Definition: ABLPlot.h:21
Int32 mPieRotation
Definition: PiePlotRenderer.h:35
Definition: PiePlotRenderer.h:38
Int32 mDepthInChart
Definition: PiePlotRenderer.h:34
EnumGraphMatrixPiePlotType
Definition: Dataset.h:135
std::vector< GMDataLabelInfo > GMDataLabelVecs
Definition: DataLabelManager.h:93
MSynch::SmartPtr< PiePlotRenderer > Ptr
Definition: PiePlotRenderer.h:41
Definition: GraphObjectManager.h:37
EnumGraphMatrixDataIndexType
Definition: Dataset.h:125
EnumPieLayout
Definition: PiePlot.h:22
Definition: Common.h:397