Mobile API Reference  MicroStrategy 2019
RadarPlot.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : RadarPlot.h
3 // AUTHOR : Liang Liu
4 // CREATION : 2009-04-07
5 // Copyright (C) MicroStrategy Incorporated 2009
6 // All Rights Reserved
7 //==============================================================================================
8 
9 #ifndef MsiChart_RadarPlot_h
10 #define MsiChart_RadarPlot_h
11 
12 #include "PolarPlot.h"
13 #include "RadarCategoryAxis.h"
14 
15 namespace MsiChart
16 {
18  {
20  : mDataIndex(0),
21  mShowMarkers(false),
22  mMarkerSize(33),
24  {
25  }
27  bool mShowMarkers;
29  unsigned char mMarkerShape;
30  };
31 
33  class RadarPlot : public PolarPlot
34  {
35  public:
37 
41  RadarPlot(const TripleId& irTripleId, GraphObjectManager* ipManager, const Rect2D& irDeviceRect);
42 
43  //virtual functions from GraphObjectManager
44  virtual void GenerateMapAndList();
45  virtual void GetOptions(Int32 iSeriesId, Int32 iPropertyId, CComVariant* opValue) const;
46  //virtual void Draw();
47 
48  //override functions
49  //virtual void OnRectangleSelection(const Rect2D& irRect, std::vector<GraphObject::Ptr>& iorSelectedObjects) const;
50 
51  private:
52  virtual PolarValueAxis::Ptr hGenerateXAxis();
56  void hLoadProperties();
57  void hGenerateAreaForSeries(Int32 iSeriesIndex, std::vector<Point2D>& orSeriesPoints);
58  //void hGenerateDataLineForSeries(Int32 iSeriesIndex);
59 
61  //void hGenerateAxes();
62 
68  //void hGenerateMarkersBySeries(const std::vector<Point2D>& irPoints, Int32 iSeriesIndex, std::vector<Rect2D>& orMarkerRects);
69 
75  //void hGenerateDataLinesBySeries(const std::vector<FPoint2D>& irPolarPoints, Int32 iSeriesIndex);
76 
77  //void hGenerateOneDataLine(const std::vector<FPoint2D>& irPolarPointSet, Int32 iSeriesIndex, GraphCollectionObject* ipDataLineSet);
78 
79  //void hGenerateDatalabels(const std::vector<Rect2D>& irRects, Int32 iSeriesIndex);
80  //virtual TextObject::Ptr hCreateDataLabel(Int32 iSeriesIndex, Int32 iGroupID, GraphCollectionObject* ipCollection);
81  virtual bool hGetValueString(Int32 iSeriesIndex, Int32 iGroupID, MBase::String& orValue, GraphCollectionObject* ipCollection);
82  //bool hGetVAFormattedText(Int32 iSeriesIndex, Int32 iGroupID, MBase::String& orText);
88  void hGetMinMaxValueForValueAxis(double& orMin, double& orMax);
89 
90  //Point2D hGetPointByAngleAndRadius(double iAngleRad, double iRadius) const;
91 
92  void hMoveDataLabel(TextObject* ipText, const Rect2D& irRefRect);
93 
94  //void hCreateTrendLines();
95 
100  void hLoadSeriesProperties(Int32 iSeriesIndex);
101 
102  void hParseSubGraphType();
113  virtual bool GetData(Int32 iSeriesIndex, Int32 iGroupId, bool iIsXValue, double& orValue) const;
114  void hInitCumulateData(EnumValueAxis iValueAxis);
121  bool hGetSeriesPolygon(Int32 iSeriesIndex, Polygon2D& orPolygon);
122  bool hGetStackedPolygon(Int32 iSeriesIndex, Polygon2D& orPolygon);
123  void hParseStackedPolygonUnits(const Polygon2D& irPolygon, std::vector<std::vector<Point2D> >& orPolygonUnits);
124  //void hParseSeriesPoints(const std::vector<FPoint2D> irOuterPoints, const std::vector<FPoint2D> irInnerPoints, std::vector<std::vector<FPoint2D> >& orPointGroups) const;
133  double hGetCumulateData(EnumValueAxis iValueAxis, Int32 iDataIndex, Int32 iGroupId) const;
134  void hGenerateTotalLabelsByAxis(EnumValueAxis iValueAxisIndex, GraphCollectionObject::Ptr iTotalCollectionPtr,
135  const std::vector<std::vector<Rect2D> >& irMarkerRectangleMatrix);
136  TextObject::Ptr CreateTotalLabel(const EnumValueAxis iValueAxis, const Int32 iGroupId, GraphCollectionObject::Ptr iTotalCollectionPtr);
137  const Int32 GetUpmostIndexByValueAxisAndGroup(const EnumValueAxis iValueAxis, const Int32 iGroupId) const;
138  //void MoveLabel(Int32 iGroupId, TextObject::Ptr iTextObjectPtr, const Point2D& irMax, const Point2D& irMin, Int32 iInfoIndex);
139  virtual void hMoveDataLabel(TextObject* ipText, const Rect2D& irRefRect, Int32 iSeriesIndex);
140 
141  bool mIsDualAxis;
142  bool mShowCumulate;
143  bool mShowTotal;
144 
146  std::vector<double> mCumulateData[2];
148  Int32 mSeriesNumber[2];
149 
150  std::vector<RadarSeriesInfo> mRadarSeriesInfo;
151  };
152 
153  inline double RadarPlot::hGetCumulateData(EnumValueAxis iValueAxis, Int32 iDataIndex, Int32 iGroupId) const
154  {
155  return mCumulateData[iValueAxis][iGroupId * mSeriesNumber[iValueAxis] + iDataIndex];
156  }
157 
158 }
159 #endif
Definition: PolarPlot.h:34
virtual void GetOptions(Int32 iSeriesId, Int32 iPropertyId, CComVariant *opValue) const
Int32 mDataIndex
Indicates the data index for this series ID in specified value axis.
Definition: RadarPlot.h:26
Definition: GraphCollectionObject.h:19
bool mShowMarkers
Indicates whether to show data markers.
Definition: RadarPlot.h:27
EnumValueAxis
Definition: Plot.h:54
unsigned char mMarkerShape
Indicates the marker shape.
Definition: RadarPlot.h:29
Definition: DSSIPhoneEnums.h:1982
std::vector< Point2D > Polygon2D
Definition: GraphObject.h:25
#define Int32
Definition: BasicTypes.h:20
RadarPlot(const TripleId &irTripleId, GraphObjectManager *ipManager, const Rect2D &irDeviceRect)
Definition: TextObject.h:181
Int32 mMarkerSize
Indicates the marker size.
Definition: RadarPlot.h:28
Definition: RadarPlot.h:33
virtual void GenerateMapAndList()
Definition: SmartPtr.h:38
std::basic_string< WCHAR, std::char_traits< WCHAR >, Allocator< WCHAR > > String
Definition: BaseString.h:26
Definition: ABLPlot.h:21
MSynch::SmartPtr< RadarPlot > Ptr
Definition: RadarPlot.h:36
Definition: Msi_ccomvariant.h:24
RadarSeriesInfo()
Definition: RadarPlot.h:19
Definition: GraphObjectManager.h:37
Use four Int32 values to represent a 2D rectangle.
Definition: Rect2D.h:25
This class is used to generate radar chart.
Definition: RadarPlot.h:17
Definition: Common.h:397