Mobile API Reference  MicroStrategy 2019
PolarPlot.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : PolarPlot.h
3 // AUTHOR : Liang Liu
4 // CREATION : 2009-02-16
5 // Copyright (C) MicroStrategy Incorporated 2009
6 // All Rights Reserved
7 //==============================================================================================
8 
9 #ifndef MsiChart_PolarPlot_h
10 #define MsiChart_PolarPlot_h
11 
12 #include "PDCHeader/PDCvector"
13 
14 #include "NumberObject.h"
15 #include "Plot.h"
16 #include "PolarValueAxis.h"
17 
18 namespace MsiChart
19 {
21  {
24  mShowDataLabels(true)
25  {
26  }
31  };
32 
34  class PolarPlot : public Plot
35  {
36  public:
38 
43  PolarPlot(const TripleId& irTripleId, GraphObjectManager* ipManager, const Rect2D& irDeviceRect, bool iIsRadar = false);
44 
45  //virtual functions from GraphObjectManager
46  virtual void GenerateMapAndList();
47  virtual void GetOptions(Int32 iSeriesId, Int32 iPropertyId, CComVariant* opValue) const;
48  virtual void Draw();
49  virtual void GenerateView();
50 
51  protected:
55  bool GenerateAxes();
64  void GenerateMarkersBySeries(const std::vector<Point2D>& irPoints, Int32 iSeriesIndex,
65  unsigned char iMarkerShape, Int32 iMarkerPixelSize, std::vector<Rect2D>& orMarkerRects);
66 
72  void GenerateDatalabels(const std::vector<Rect2D>& irRects, Int32 iSeriesIndex);
85  void GenerateDataLinesBySeries(const std::vector<FPoint2D>& irPolarPoints, Int32 iSeriesIndex, GraphCollectionObject* ipCollection);
86 
94  CurveLineObject::Ptr CreateOneCurveLine(const std::vector<FPoint2D>& irPolarPointSet, Int32 iSeriesIndex, GraphCollectionObject* ipDataLineSet);
95 
97  void CreateTrendLines();
105  bool CalculateSeriesPolarPoints(Int32 iSeriesIndex, std::vector<FPoint2D>& orSeriesPolarPoints, bool iIsPreValue = false) const;
106 
112  void ParsePolarPoints(const std::vector<FPoint2D>& irPolarPoints, std::vector<std::vector<FPoint2D> >& orPointGroups) const;
117  void AppendFirstPolarPoint(std::vector<FPoint2D>& iorSeriesPolarPoints) const;
127  bool GetVAFormattedText(Int32 iSeriesIndex, Int32 iGroupID, bool iIsXValue, double iValue, MBase::String& orText, GraphCollectionObject* ipCollection);
134  Point2D GetPointByAngleAndRadius(double iAngleRad, double iRadius) const;
135 
141  void PolarToCartesian(const std::vector<FPoint2D>& irPolarPoints, std::vector<Point2D>& orCartesianPoints);
142 
143  void MergeGraphObjectList();
147  void LoadProperties();
148 
149 
151 
155 
156  std::vector<PolarSeriesInfo> mSeriesOptions;
158 
166  bool mIsStacked;
171 
174 
175  private:
185  virtual bool GetData(Int32 iSeriesIndex, Int32 iGroupId, bool iIsXValue, double& orValue) const;
186 
187  virtual PolarValueAxis::Ptr hGenerateXAxis();
188 
189  void hGenerateOneDataLine(const std::vector<FPoint2D>& irPolarPointSet, Int32 iSeriesIndex, GraphCollectionObject* ipDataLineSet);
190 
191  TextObject::Ptr hCreateDataLabel(Int32 iSeriesIndex, Int32 iGroupID, GraphCollectionObject* ipCollection);
192  virtual bool hGetValueString(Int32 iSeriesIndex, Int32 iGroupID, MBase::String& orValue, GraphCollectionObject* ipCollection);
199  void hGetMinMaxValueForValueAxis(EnumValueAxis iValueAxis, double& orMin, double& orMax) const;
200 
201  virtual void hMoveDataLabel(TextObject* ipText, const Rect2D& irRefRect, Int32 iSeriesIndex);
202 
203  void hDrawTrendLinesAndEquations(bool iIsY2);
204 
209  void hLoadSeriesProperties(Int32 iSeriesIndex);
210 
211  void hCalculateTickAngles();
212 
213  bool hIsAxisOnTop() const;
214 
215  bool mIsRadarChart;
216  };
217 
218  inline bool PolarPlot::hIsAxisOnTop() const
219  {
220  return mIsRadarChart && (mIsAreaRadar || mIsStacked);
221  }
222 }
223 #endif
PolarInfo mPolarInfo
Maintains polar information.
Definition: PolarPlot.h:150
bool mIsAreaRadar
Definition: PolarPlot.h:170
PolarValueAxis::Ptr mY1AxisPtr
Y1 Axis.
Definition: PolarPlot.h:153
PolarValueAxis::Ptr mY2AxisPtr
Y2 Axis.
Definition: PolarPlot.h:154
CurveLineObject::Ptr CreateOneCurveLine(const std::vector< FPoint2D > &irPolarPointSet, Int32 iSeriesIndex, GraphCollectionObject *ipDataLineSet)
Definition: PolarPlot.h:34
This class is used to generate polar chart.
Definition: PolarPlot.h:20
bool mIsStacked
Definition: PolarPlot.h:166
This struct is from ChartCtrl.h.
Definition: NumberObject.h:38
void PolarToCartesian(const std::vector< FPoint2D > &irPolarPoints, std::vector< Point2D > &orCartesianPoints)
Definition: PolarValueAxis.h:20
Definition: GraphCollectionObject.h:19
bool mUseCircularDataLines
Definition: PolarPlot.h:162
virtual void GenerateView()
EnumValueAxis
Definition: Plot.h:54
void ParsePolarPoints(const std::vector< FPoint2D > &irPolarPoints, std::vector< std::vector< FPoint2D > > &orPointGroups) const
PolarValueAxis::Ptr mXAxisPtr
X Axis.
Definition: PolarPlot.h:152
virtual void GenerateMapAndList()
bool CalculateSeriesPolarPoints(Int32 iSeriesIndex, std::vector< FPoint2D > &orSeriesPolarPoints, bool iIsPreValue=false) const
Int32 mLabelLocation
Data label location.
Definition: PolarPlot.h:172
ChartAdvFormat mNumberFormat
Number format of data labels.
Definition: PolarPlot.h:30
MSynch::SmartPtr< PolarPlot > Ptr
Definition: PolarPlot.h:37
EnumValueAxis mValueAxisIndex
Value axis index - Y1 or Y2.
Definition: PolarPlot.h:27
#define Int32
Definition: BasicTypes.h:20
bool mShowDataLabels
Show data labels or not.
Definition: PolarPlot.h:28
Definition: TextObject.h:181
Int32 mLabelFormat
Data label format.
Definition: PolarPlot.h:173
std::vector< PolarSeriesInfo > mSeriesOptions
Series options.
Definition: PolarPlot.h:156
Definition: SmartPtr.h:38
void AppendFirstPolarPoint(std::vector< FPoint2D > &iorSeriesPolarPoints) const
bool GetVAFormattedText(Int32 iSeriesIndex, Int32 iGroupID, bool iIsXValue, double iValue, MBase::String &orText, GraphCollectionObject *ipCollection)
Int32 mGroupCount
Number of groups.
Definition: PolarPlot.h:157
std::basic_string< WCHAR, std::char_traits< WCHAR >, Allocator< WCHAR > > String
Definition: BaseString.h:26
Definition: ABLPlot.h:21
GraphTrendLineOptions mTrendLineOptions
Trendline options.
Definition: PolarPlot.h:29
void GenerateMarkersBySeries(const std::vector< Point2D > &irPoints, Int32 iSeriesIndex, unsigned char iMarkerShape, Int32 iMarkerPixelSize, std::vector< Rect2D > &orMarkerRects)
Definition: Plot.h:56
Definition: Msi_ccomvariant.h:24
void GenerateDatalabels(const std::vector< Rect2D > &irRects, Int32 iSeriesIndex)
PolarPlot(const TripleId &irTripleId, GraphObjectManager *ipManager, const Rect2D &irDeviceRect, bool iIsRadar=false)
PolarSeriesInfo()
Definition: PolarPlot.h:22
Definition: Plot.h:70
virtual void Draw()
virtual void GetOptions(Int32 iSeriesId, Int32 iPropertyId, CComVariant *opValue) const
Definition: GraphObjectManager.h:37
void GenerateDataLinesBySeries(const std::vector< FPoint2D > &irPolarPoints, Int32 iSeriesIndex, GraphCollectionObject *ipCollection)
Use four Int32 values to represent a 2D rectangle.
Definition: Rect2D.h:25
Point2D GetPointByAngleAndRadius(double iAngleRad, double iRadius) const
void CreateTrendLines()
Create trend lines.
Definition: Plot.h:30
GraphCollectionObject * GenerateSeriesDataLineCollection(Int32 iSeriesIndex)
Definition: Common.h:397