Mobile API Reference  MicroStrategy 2019
StockPlot.h
Go to the documentation of this file.
1 //====================================================================
2 // Filename: Kernel/SourceCode/ChartEngine/PrivateSource/StockPlot.h
3 // AUTHOR : Xin Liu
4 // CREATION : 4/08/09
5 // Copyright (C) MicroStrategy, Inc. 2009
6 //==============================================================================================
7 
8 #ifndef MSICHART_STOCKPLOT_H
9 #define MSICHART_STOCKPLOT_H
10 
11 
12 #include "CategoryPlot.h"
13 #include "NumberObject.h"
14 #include "ValueAxis.h"
15 #include "CategoryAxis.h"
16 
17 namespace MsiChart
18 {
20  {
24  };
25 
27  {
29  : mStockMetricShow(false)
31  // , mStockMetricValue(L"")
32  , mOffsetInDataset(-1)
33  {}
34 
36  unsigned char mStockMetricLayout;
37  // MBase::String mStockMetricValue;
39  };
40 
41  struct StockOptions
42  {
44  : mGapWidth(40)
46  , mShowOpen(false)
47  , mShowClose(false)
51  {}
52 
54  unsigned char mStockLayout;
55  bool mShowOpen;
56  bool mShowClose;
61  };
62 
64  {
66 
68  : mShowDataLabels(false)
69  {}
70 
74  };
75 
76  class StockPlot: public CategoryPlot
77  {
78  public:
80 
81  StockPlot(const TripleId& irTripleId, GraphObjectManager* ipManager, const Rect2D& irDataArea);
82  ~StockPlot();
83 
84  //Re-implemention the virtual functions inherited from GraphObjectManager
85  // virtual GraphObject::Ptr OnPointDetection(const Point2D& irCursor) const;
86  // virtual void OnRectangleSelection(const Rect2D& irRect, std::vector<GraphObject::Ptr>& iorSelectedObjects) const;
87  // virtual void Draw();
88  // virtual void GenerateImageMap(ImageMap& iorImageMap);
89  virtual void GenerateMapAndList();
90  virtual void GetOptions(Int32 iSeriesId, Int32 iPropertyId, CComVariant* opValue) const;
91 
92  //Re-implemention the virtual functions inherited from CategoryPlot
93  virtual void Init();
94  virtual void GetMinMaxValue(EnumValueAxis iValueAxis, double& iorMin, double& iorMax, bool& iorAreInitialized);
95  virtual void AddValueAxis(ValueAxis::Ptr iValueAxisPtr);
96  virtual void SetCategoryAxis(CategoryAxis::Ptr iCategoryAxisPtr);
97 
98  private:
102  void hLoadProperties();
103 
108  void hLoadSeriesProperties(Int32 iSeriesId);
109 
112  void hInitializeCollections();
113 
116  void hGenerateOneSeries(Int32 iSeriesIndex);
117 
120  void hGenerateOneRiser(Int32 iSeriesIndex, Int32 iGroupId);
121 
122  void hGenerateOneRiserForY2Y3Y4(Int32 iSeriesIndex, Int32 iGroupId, EnumStockValueAxisIndex iValueAxis
123  , Int32 iRiserStartX, Int32 iRiserSizeX, GraphCollectionObject* ipCollection);
124 
125  void hGetRiserStartPosAndSize(Int32 iGroupId, Int32& orStart, Int32& orSize, Int32& orLeftGapWidth, Int32 &orRightGaphWidth);
126 
127  Int32 hGetSideRiserHeight();
128 
129  void hGetDataPointsPolyLine(Int32 iSeriesIndex, std::vector<std::vector<Point2D> >& orVecDataPolyLine, bool iIncludeBase = false);
130 
131  void hGetDataPointsPolyLineForY2Y3Y4(Int32 iSeriesIndex, std::vector<std::vector<Point2D> >& orVecDataPolyLine
132  , EnumStockValueAxisIndex iValueAxis, bool iIncludeBase = false);
133 
142  TextObject::Ptr hCreateDataLabel(Int32 iSeriesIndex, Int32 iGroupId, double iValue, GraphCollectionObject::Ptr iDataLabelCollectionPtr);
143 
144  void hGetTrendlineData(Int32 iSeriesIndex, std::vector<double>& orVecX, std::vector<double>& orVecY);
145 
146  void hGenerateTrendline();
147 
148  Int32 hGetSeriesIdForY2Y3Y4Risers(Int32 iSeriesIndex, EnumStockValueAxisIndex iValueAxis);
149 
150  //private members
151  ValueAxis::Ptr mY1AxisPtr;
152  ValueAxis::Ptr mY2AxisPtr;
153  ValueAxis::Ptr mY3AxisPtr;
154  ValueAxis::Ptr mY4AxisPtr;
155  CategoryAxis::Ptr mO1AxisPtr;
156 
157  StockOptions mStockOptions;
158  std::vector<StockSeriesOptions::Ptr> mStockSeriesOptions;
159 
160  Int32 mSeriesCount;
161  Int32 mGroupCount;
162  bool mIsLineRiser;
163  std::vector<GraphCollectionObject::Ptr> mRiserCollections;
164  std::vector<GraphCollectionObject::Ptr> mDataLabelCollections;
165  std::map<Int32, GraphCollectionObject::Ptr> mY2Y3Y4RiserCollections;
166  };
167 }
168 
169 #endif
Definition: DSSIPhoneEnums.h:1879
StockSeriesOptions()
Definition: StockPlot.h:67
ChartAdvFormat mGraphNumberFormat
Definition: StockPlot.h:73
virtual void SetCategoryAxis(CategoryAxis::Ptr iCategoryAxisPtr)
EnumDSSGraphStockDataValueType mStockDataValueType
Definition: StockPlot.h:58
unsigned char mStockMetricLayout
Definition: StockPlot.h:36
Int32 mOffsetInDataset
Definition: StockPlot.h:38
Definition: StockPlot.h:76
Definition: StockPlot.h:63
EnumStockValueAxisIndex
Definition: StockPlot.h:19
This struct is from ChartCtrl.h.
Definition: NumberObject.h:38
Definition: GraphCollectionObject.h:19
EnumValueAxis
Definition: Plot.h:54
Definition: CategoryPlot.h:27
Definition: DSSIPhoneEnums.h:1851
virtual void GetMinMaxValue(EnumValueAxis iValueAxis, double &iorMin, double &iorMax, bool &iorAreInitialized)
EnumDSSGraphStockDataValueType
Definition: DSSIPhoneEnums.h:1877
EnumDSSGraphDataTextPosition
Definition: DSSIPhoneEnums.h:1836
Int32 mGapWidth
Gap width between groups.
Definition: StockPlot.h:53
virtual void GetOptions(Int32 iSeriesId, Int32 iPropertyId, CComVariant *opValue) const
Definition: DSSIPhoneEnums.h:2098
#define Int32
Definition: BasicTypes.h:20
Int32 mStockRiserDataGroup
Definition: StockPlot.h:59
Definition: StockPlot.h:26
Definition: StockPlot.h:22
Definition: SmartPtr.h:38
Definition: StockPlot.h:23
GraphTrendLineOptions mTrendLineOptions
Definition: StockPlot.h:72
Definition: DSSIPhoneEnums.h:1842
unsigned char mStockLayout
Definition: StockPlot.h:54
Definition: StockPlot.h:41
StockMetricOptions()
Definition: StockPlot.h:28
Definition: ABLPlot.h:21
bool mStockMetricShow
Definition: StockPlot.h:35
StockOptions()
Definition: StockPlot.h:43
StockPlot(const TripleId &irTripleId, GraphObjectManager *ipManager, const Rect2D &irDataArea)
EnumDSSGraphDataTextPosition mTextPosition
Definition: StockPlot.h:57
MSynch::SmartPtr< StockSeriesOptions > Ptr
Definition: StockPlot.h:65
virtual void GenerateMapAndList()
Definition: Msi_ccomvariant.h:24
bool mShowOpen
Definition: StockPlot.h:55
bool mShowDataLabels
Definition: StockPlot.h:71
MSynch::SmartPtr< StockPlot > Ptr
Definition: StockPlot.h:79
Definition: StockPlot.h:21
Definition: GraphObjectManager.h:37
bool mShowClose
Definition: StockPlot.h:56
virtual void Init()
Use four Int32 values to represent a 2D rectangle.
Definition: Rect2D.h:25
StockMetricOptions mStockMetricOptions[3]
Definition: StockPlot.h:60
Definition: Plot.h:30
virtual void AddValueAxis(ValueAxis::Ptr iValueAxisPtr)
Definition: Common.h:397