Mobile API Reference  MicroStrategy 2019
HistogramPlot.h
Go to the documentation of this file.
1 //====================================================================
2 // Filename: Kernel/SourceCode/ChartEngine/PrivateSource/HistogramPlot.h
3 // AUTHOR : Xin Liu
4 // CREATION : 2/13/09
5 // Copyright (C) MicroStrategy, Inc. 2009
6 //==============================================================================================
7 
8 #ifndef MSICHART_HISTOGRAMPLOT_H
9 #define MSICHART_HISTOGRAMPLOT_H
10 
11 #include "Plot.h"
12 #include "ValueAxis.h"
13 #include "CategoryPlot.h"
14 #include "NumberObject.h"
15 
16 namespace MsiChart
17 {
19  {
23  , mUseDepth(false)
24  , mDepth(200)
25  , mDepthDirection(45)
26  , mShowDataLabel(false)
27  , mGapWidth(40)
29  {}
33  bool mUseDepth;
37  // bool mShowValue;
39  // EnumDSSGraphDataTextShowType mTextShowType;
42  };
43 
44  /*
45  struct HistogramSeriesOptions
46  {
47  typedef MSynch::SmartPtr<HistogramSeriesOptions> Ptr;
48 
49  SeriesOptions() : mShowDataLabels(false)
50  {}
51 
52  bool mShowDataLabels;
53  GraphTrendLineOptions mTrendLineOptions;
54  ChartAdvFormat mGraphNumberFormat;
55  };
56 
57 
58  struct HistogramPlotContext
59  {
60  HistogramOptions mHistogramOptions;
61 
62  ValueAxis::Ptr mXValueAxis;
63  ValueAxis::Ptr mY1ValueAxis;
64  };
65  */
69  class HistogramPlot: public Plot
70  {
71  public:
73 
74  HistogramPlot(const TripleId& irTripleId, GraphObjectManager* ipManager, const Rect2D& irDataArea);
76 
77  //Re-implemention the virtual functions inherited from GraphObjectManager
78  virtual GraphObject::Ptr OnPointDetection(const Point2D& irCursor) const;
79  virtual void OnRectangleSelection(const Rect2D& irRect, std::vector<GraphObject::Ptr>& iorSelectedObjects) const;
80  virtual void Draw();
81  virtual void GenerateView();
82  virtual void GenerateImageMap(ImageMap& iorImageMap);
83  virtual void GenerateMapAndList();
84  virtual void GetOptions(Int32 iSeriesId, Int32 iPropertyId, CComVariant* opValue) const;
85 
86  virtual bool GetToolTipData(Int32 iSeriesID, Int32 iGroupID, double& orValue, double& orPercentValue);
87  virtual bool GetToolTipData(Int32 iSeriesID, Int32 iGroupID, double& orValue, double& orPercentValue, Int32 iOffset);
88 
96  void GetXMinMaxValue(double& iorMin, double& iorMax, bool& iorIsInitialized);
97 
104  void GetY1MinMaxValue(double& iorMin, double& iorMax, bool& iorIsInitialized);
105 
111  void SetXValueAxis(ValueAxis::Ptr iValueAxisPtr);
112 
118  void SetY1ValueAxis(ValueAxis::Ptr iValueAxisPtr);
119 
125  bool IsReverseGroupOrder();
126 
127  protected:
128  virtual void SetGraphType(EnumDSSGraphType iType);
129 
130  private:
134  void hCalculateHistogramData();
135 
139  void hLoadProperties();
140 
144  void hLoadTrendlineProperties();
145 
150  void hGenerateOneRiser(Int32 iGroupId);
151 
158  void hGetRiserStartPosAndSize(Int32 iGroupId, Int32& orStart, Int32& orSize);
159 
167  TextObject::Ptr hCreateDataLabel(Int32 iGroupId, const double& irValue, GraphCollectionObject::Ptr iDataLabelCollectionPtr);
168 
172  void hGenerateTrendline();
173 
174  //private members
175  std::vector<double> mHistogramData;
176  std::vector<double> mHistogramDataX;
177  ValueAxis::Ptr mXValueAxisPtr;
178  ValueAxis::Ptr mY1ValueAxisPtr;
179  HistogramOptions mHistogramOptions;
180 
181  GraphCollectionObject::Ptr mRiserCollectionPtr;
182  GraphCollectionObject::Ptr mDataLabelCollectionPtr;
183  };
184 }
185 
186 #endif
Int32 mDepth
Definition: HistogramPlot.h:34
Definition: HistogramPlot.h:18
void SetY1ValueAxis(ValueAxis::Ptr iValueAxisPtr)
Int32 mGapWidth
Gap width between groups.
Definition: HistogramPlot.h:32
virtual void OnRectangleSelection(const Rect2D &irRect, std::vector< GraphObject::Ptr > &iorSelectedObjects) const
MSynch::SmartPtr< HistogramPlot > Ptr
Definition: HistogramPlot.h:72
void GetY1MinMaxValue(double &iorMin, double &iorMax, bool &iorIsInitialized)
HistogramPlot(const TripleId &irTripleId, GraphObjectManager *ipManager, const Rect2D &irDataArea)
This struct is from ChartCtrl.h.
Definition: NumberObject.h:38
virtual void GenerateView()
EnumDSSGraphType mGraphType
Definition: HistogramPlot.h:30
bool mShowDataLabel
Definition: HistogramPlot.h:36
virtual GraphObject::Ptr OnPointDetection(const Point2D &irCursor) const
EnumDSSGraphDataTextPosition
Definition: DSSIPhoneEnums.h:1836
ChartAdvFormat mGraphNumberFormat
Definition: HistogramPlot.h:40
Definition: HistogramPlot.h:69
#define Int32
Definition: BasicTypes.h:20
Int32 mDepthDirection
Definition: HistogramPlot.h:35
void SetXValueAxis(ValueAxis::Ptr iValueAxisPtr)
virtual void GetOptions(Int32 iSeriesId, Int32 iPropertyId, CComVariant *opValue) const
HistogramOptions()
Definition: HistogramPlot.h:20
Definition: SmartPtr.h:38
EnumDSSGraphType
Definition: DSSIPhoneEnums.h:2431
EnumOrientation
Definition: CategoryPlot.h:21
virtual void SetGraphType(EnumDSSGraphType iType)
EnumDSSGraphDataTextPosition mTextPosition
Definition: HistogramPlot.h:38
Definition: DSSIPhoneEnums.h:1842
virtual bool GetToolTipData(Int32 iSeriesID, Int32 iGroupID, double &orValue, double &orPercentValue)
GraphTrendLineOptions mTrendLineOptions
Definition: HistogramPlot.h:41
Definition: ABLPlot.h:21
bool mUseDepth
Definition: HistogramPlot.h:33
virtual void GenerateMapAndList()
std::vector< AreaRec * > ImageMap
Definition: ImageMap.h:99
Definition: DSSIPhoneEnums.h:2504
void GetXMinMaxValue(double &iorMin, double &iorMax, bool &iorIsInitialized)
Definition: Msi_ccomvariant.h:24
virtual void GenerateImageMap(ImageMap &iorImageMap)
Definition: Plot.h:70
Definition: GraphObjectManager.h:37
Definition: CategoryPlot.h:24
Use four Int32 values to represent a 2D rectangle.
Definition: Rect2D.h:25
Definition: Plot.h:30
Definition: Common.h:397
EnumOrientation mOrientation
Definition: HistogramPlot.h:31