Mobile API Reference  MicroStrategy 2019
ChartImpl.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : ChartImpl.h
3 // AUTHOR : Xin Liu
4 // CREATION : 5/20/08
5 // Copyright (C) MicroStrategy, Inc. 2008
6 //==============================================================================================
7 
8 
9 #ifndef MSICHART_CHARTIMPL_H
10 #define MSICHART_CHARTIMPL_H
11 
12 #include "../Chart.h"
13 
14 #include "GraphObject.h"
15 #include "ChartManager.h"
16 #include "ChartContext.h"
17 #ifdef _VE_CE
18 #include "ChartCanvas.h"
19 #else
20 #include "LayerObject.h"
21 #endif
22 #include "ValueAxis.h"
23 #include "CategoryAxis.h"
24 #include "NumberObject.h"
25 
26 namespace MsiChart
27 {
31  class ChartImpl: public Chart
32  {
33  public:
34  //Initialization and Termination
35  ChartImpl(Dataset::Ptr iDatasetPtr);
36  //ChartImpl(GraphStyleWrapper* ipGraphStyleWrapper, Dataset::Ptr iDatasetPtr);
37  ChartImpl(Dataset::Ptr iDatasetPtr, const char* ipGDFFileName);
38  ChartImpl(Dataset::Ptr iDatasetPtr, FormatManager::Ptr iFormatManagerPtr, const char* ipGDFFileName, bool iForceGraph);
39  virtual void Delete();
40 
41  static bool Initialize();
42  static bool Finalize();
43 
44  //Setting/Getting Data
45  void SetData(Dataset::Ptr iDatasetPtr);
47  bool GetToolTipData(Int32 iSeriesID, Int32 iGroupID, double& orValue, double& orPercentValue, Int32 iOffset = 0);
48  bool GetToolTipDataString(Int32 iSeriesID, Int32 iGroupID, MBase::String& orDataString, Int32 iOffset = 0);
49  bool GetPrimaryDataString(Int32 iSeriesID, Int32 iGroupID, MBase::String& orDataString, bool iIsForColor, Int32 iSizebyIndex = 0);
50  bool GetPrimaryDataStringForPie(Int32 iSeries, Int32 iGroupID, MBase::String& orDataString, bool iIsForColor, Int32 iColumnOffset = 0, bool isPercentValue = false, Int32 iAngleIndex = -3, Int32 iSliceIndex = -3);
51  bool GetPieSliceTooltipDataString(Int32 iSeriesID, Int32 iGroupID, Int32 iAngleID, Int32 iSliceID, Int32 iColumnOffset, MBase::String& orDataString);
52  bool GetToolTipDataString(Int32 iSeriesID, Int32 iGroupID, MBase::String& orDataString, MBase::String& orPercentDataString, Int32 iOffset = 0);
53 
54  //Setting/Getting Attributes
55  bool SetOptions(Int32 iObjectId, Int32 iSeriesId, Int32 iGroupId,
56  Int32 iPropertyId, CComVariant* ipValue);
57  bool GetOptions(Int32 iObjectId, Int32 iSeriesId, Int32 iGroupId,
58  Int32 iPropertyId, CComVariant* opValue);
59  void SetGraphType(short iGraphType);
60  void GetGraphType(short& orGraphType);
61  Int32 GetGraphWidth() const;
62  Int32 GetGraphHeight() const;
63  void SetCurrentGraphFrame(Int32 iX, Int32 iY, Int32 iWidth, Int32 iHeight);
64 
65  void SetAdvancedChartTypeSupport(bool iAdvancedChartTypeSupport);
66 
67  //User Interactivity
68  bool OnPointDetection(Int32 iX, Int32 iY, bool iSmartSelection, TripleId& orSelectedObject);
69  bool GetNearestObject(Int32 iX, Int32 iY, const std::vector<Int32>& irObjectIds,Int32 iRadius, TripleId& orNearestTripleId, int* opNearestDistance = NULL);
70  bool GetNearestObjectForGMCombo(Int32 iX, Int32 iY, const std::vector<Int32>& irObjectIds,Int32 iRadius, TripleId& orNearestTripleId, int* opNearestDistance = NULL);
71  bool GetAllObjectsWithInDistance(Int32 iX, Int32 iY, const std::vector<Int32>& irObjectIds, Int32 iRadius, std::vector<SelectedInfo>& orNearObjects, std::vector<Int32>& orDistance);
72  bool OnRectangleSelection(Int32 iLeft, Int32 iTop, Int32 iWidth, Int32 iHeight,
73  bool iSmartSelection, TripleId*& orpSelectionList, Int32 &oNum);
74 
75  bool IsInSelectionList(const TripleId& iObject);
76  bool AddToSelectionList(const TripleId& iObject);
77  bool RemoveFromSelectionList(const TripleId& iObject);
78  // void GetSelectionList(std::vector<TripleId>& orSelectionList);
79  void ClearSelectionList();
80 
81  virtual void AllocSelectionList(TripleId*& orpSelectionList, Int32 &oNum);
82  virtual void DisposeSelectionList(TripleId* ipSelectionList);
83 
84  //Export
85  bool SaveImageToMemory(Int32 iWidth, Int32 iHeight, Int32 iFormat,
86  char*& oprMemory, unsigned Int32& orSize);
87  bool SaveImageToFile(Int32 iWidth, Int32 iHeight,
88  Int32 iFormat, const char* ipFilename);
89 #ifdef _VE_CE
90  bool SaveImageToString(Int32 iWidth, Int32 iHeight, std::string& orGraphDesc,
91  bool ibRowsHaveControls, bool ibColumnsHaveControls, bool ibHasMetricSelector,
92  std::vector<std::pair<Int32, Int32> >& iSelectedSeriesAndColumns,
93  bool ibSkipRendering = true);
94 
95  bool SaveImageToVEObjects(Int32 iWidth, Int32 iHeight,
96  std::vector<MVE::VEFormatList>& ioFormatList, std::vector<MVE::VEUnitList>& ioUnitList,
97  bool ibRowsHaveControls, bool ibColumnsHaveControls, bool ibHasMetricSelector,
98  std::vector<std::pair<Int32, Int32> >& iSelectedSeriesAndColumns,
99  bool ibSkipRendering = true);
100 
101 #else
102  bool SaveImageToCGContext(CGContext* ipCGContext, Int32 iWidth, Int32 iHeight, bool iShowValueAxis = true, Int32 iImageUsage = IU_GENERAL);
103 #endif
104  Int32 GetMaxElementRadius(Int32 iWidth, Int32 iHeight, bool iIsPerfectPadding = false);
105 
107 
108  bool ShouldRotateDataLabel(Int32 iWidth, Int32 iHeight, bool iIsForPefectPadding = false);
109 
110  bool ShouldAdjustValueAxis(Int32 iWidth, Int32 iHeight, double &irAdjustedValue, bool iIsForPefectPadding = false);
111 
112  bool GenerateImageMap(Int32 iWidth, Int32 iHeight, ImageMap& oImageMap);
113 
114 
115  //Set Default Properties
116  //void SetGraphStyle(GraphStyleWrapper::Ptr iGraphStyleWrapperPtr);
117 
118  //Graph Imaging
119  bool PlainDraw(Int32 iWidth, Int32 iHeight);
120 #ifndef _VE_CE
121  void SetCGContext(CGContext* ipCGContext);
122  void SetIsCategoryXAxisForPartialRendering(bool isForPartialRendering);
123 #endif
124  //Helper functions
125  Int32 GetChartAreaId(const TripleId& iObject);
126 
127  //Misc, tranformation bewteen device coordinate and 3DG virtual coordinate
128  void DeviceToVirtualPoint(Int32& iorX, Int32& iorY) const;
129  void VirtualToDevicePoint(Int32& iorX, Int32& iorY) const;
130 
131  Int32 GetDataGroup(bool& orIgnoreForNoSeriesOrGroup) const;
132 
133  void GetAxisNumberFormat(CComVariant* opValue) const;
134 
135  void OnZooming(Int32 iOldStart, Int32 iOldEnd, Int32 iNewStart, Int32 iNewEnd, bool iIsVertical);
136 
137  void OnZoomingByGroupRange(double iStartGroup, double iEndGroup);
138 
139  void OnZoomRestore();
140 
141  void OnSwipingOutOfZoom(Int32 iOffset);
142 
143  void OnSwipingInZoom(Int32 iX, Int32 iY);
144 
145  void SetChartComponent(Int32 iChartComponent);
146 
147  Int32 GetDataAreaSplitX() const;
148 
149  Int32 GetDataAreaSplitY() const;
150 
151  void SetDataAreaSplitX(Int32 iXCoord);
152 
154 
155  bool GetPositionById(Int32 iSeriesId, Int32 iGroupId, Int32& orX, Int32& orY);
156 
157  void ResetGroupRangeAndAxesState(Int32 iBeginGroup, Int32 iEndGroup);
158 
159  double GetGroupIntervalInPixel();
160 
161  void GetGroupLabel(Int32 iGroupId, MBase::String& orGroupLabel, const wchar_t iSeparator, bool iIsAbbreviated);
162 
163  void GetSeriesLabel(Int32 iSeriesID, MBase::String& orSeriesLabel, bool iSubstitute, Int32 iColumnOffset, bool iIsForSlice);
164 
165 #ifdef _VE_CE
166  void SetCanvas(ChartCanvas* ipCanvas);
167 
168  ChartCanvas* GetCanvas();
169 #endif
170 
171  int GetDataPointForUIMenu(Int32 iX, Int32 iY, Tooltip& ioTooltip, bool iLSMode = false);
173  int ApplySelectedObjects(Int32 iX, Int32 iY, std::vector<Point2D>& iPoints, Point2D& ioPoint);
174 
175  unsigned Int32 GetToolTipByCoords(Int32 iX, Int32 iY, std::vector<Tooltip*>& orTooltips, bool iPersistent = false);
176 
177  unsigned Int32 GetToolTipByCoords(Int32 iX, Int32 iY, std::vector<Tooltip*>& orTooltips, Int32 iDetectiveRadius, bool iPersistent = false);
178  bool CanShowTooltipById(TripleId& irId) const;
179 
180 
181  Int32 CreateTooltipByObject(TripleId* ipSelectionList, Int32 iNum, std::vector<Tooltip*>& orTooltips, bool iPersistent = false);
182  Int32 CreateTooltipByObject(const std::vector<TripleId>& irSelectionList, std::vector<Tooltip*>& orTooltips, bool iPersistent = false);
183 
184  Tooltip* CreateToolTipBySeriesAndGroup(Int32 iSeriesID, Int32 iGroupID, bool iPersistent = false);
185 
186 
187  bool OnHover(Int32 iX, Int32 iY);
188  bool OnHover(Int32 iX, Int32 iY, Int32 iDistance);
189  bool OnHover(const TripleId& irHoverObject);
190 
191  bool GetHoveredObject(TripleId& orHoveredObject, Int32 iIndex = 0);
192  bool GetHoveredLineObject(TripleId& orHoveredLineObject, Int32 iIndex = 0);
193  void SetTemplateNodeKey(const std::string& irKey);
194 
195  void SetGridGraphViewer(void* ipGridGraphViewer);
196  void EnableAnimation(bool iUseAnimation);
197  void ResetAnimationState();
198  void SetAnimationDuration(double iSeconds);
199  void HideAxisElements(bool iHide);
200 
201  void SetXAxisLogicalRange(double iXLogicalStart, double iXLogicalEnd);
202  void EnableTimeSeriesChart(bool iIsTimeSeriesChart);
203  void SetTimeSeriesIntegrity(Int32 iIntegrity);
204  void EnableVoiceOver(bool iIsVoiceOverMode);
205  void EnableMicroChart(bool iIsMicroChart);
206  void EnableGraphMatrix(bool iIsGraphMatrix);
207  void EnableVIDocument(bool iIsVIDocument);
208 
209  void EnableUniformAxis(GraphMatrixMinMaxInfo yMinMaxInfo, GraphMatrixMinMaxInfo xMinMaxInfo, GraphMatrixMinMaxInfo zMinMaxInfo, Int32 iGraphHeight,GraphMatrixMinMaxInfo y2MinMaxInfo = std::make_pair(-1, std::make_pair(0.0, 0.0)), GraphMatrixMinMaxInfo x2MinMaxInfo = std::make_pair(-1, std::make_pair(0.0, 0.0)) );
210  Int32 GetUniformYAxisWidth(Int32 iYAxisLength, Int32 iMetricIndex = -1, bool iIsForSecondaryAxis = false);
211  Int32 GetUniformXAxisHeight(Int32 iXAxisLength, Int32 iMetricIndex = -1, bool iIsForSecondaryAxis = false);
212  //Adjust padding for Data Label in GM
213  bool AdjustingAxisPaddingForDataLabel(Rect2D& iorRect, Int32 iMetricIndex, bool iIsForXAxis,Int32 iAxisLength);
214  bool hAdjustingXAxisPadding(Rect2D& iorRect, std::vector<Int32> iMetricIndexList,Int32 iXAxisLength);
215  bool hAdjustingYAxisPadding(Rect2D& iorRect, std::vector<Int32> iMetricIndexList,Int32 iYAxisLength);
216  TextObject::Ptr hCreateExtremeDataLabel(std::vector<Int32> iMetricIndexList, bool iIsForXAxis);
217  void GetShownNumericTicks(std::set<double>& orTicksSet, bool iIsForXAxis);
218  void SetShowNumbericTicks(std::set<double>& irTicksSet, bool iIsForXAxis);
219 #ifndef _VE_CE
220  void DrawUniformYAxis(CGContext* ipCGContext, Int32 iWidth, Int32 iHeight, bool iIsForSecondaryAxis = false);
221  void DrawUniformXAxis(CGContext* ipCGContext, Int32 iWidth, Int32 iHeight, bool iIsForSecondaryAxis = false);
222  void DrawDataAreaForUniformAxis(CGContext* ipCGContext, Int32 iWidth, Int32 iHeight);
223 #else
224  void DrawUniformYAxis(Int32 iWidth, Int32 iHeight, bool iIsForSecondaryAxis = false);
225  void DrawUniformXAxis(Int32 iWidth, Int32 iHeight, bool iIsForSecondaryAxis = false);
226  void DrawDataAreaForUniformAxis(Int32 iWidth, Int32 iHeight);
227 #endif
228  void GetUniformAxisMargins(short& orLeftMargin, short& orRightMargin, short& orTopMargin, short& orBottomMargin, bool iIsForSecondaryAxis = false);
229  void SetUniformAxisMargins(short iLeftMargin, short iRightMargin, short iTopMargin, short iBottomMargin, bool iIsForSecondaryAxis = false);
230  bool GetRowAndColumnIndexByCoords(int iX, int iY, int& orRowIndex, int& orColumnIndex, bool iIsDataCellOnly, int iDistance=-1);
231 
232  void GetStaggerLabelEndLevel(Int32& orLabelEndLevel);
233  void SetStaggerLabelStartLevel(Int32 irLabelStartLevel);
234  void SetCategoryAxisLabelInterval(Int32 irLabelInterval);
236 
237  bool IsDrillableLabelAtCoords(int iX, int iY, std::string& orLinkURL);
238 
239  void SetFormatManager(FormatManager::Ptr iFormatManagerPtr);
240 
241  void GetHighlightObjects(std::vector<std::pair<Int32, Int32> >& orHighlightObjects) const;
242  void GetHighlightObjects(std::vector<TripleId>& orHighlightObjects) const;
243 
244  void HighlightSelectedObject(bool iHighlight, bool iIsForLassoSelction = false);
245  void GetSOByLassoSelection(std::vector<std::pair<int,int> >& iObjects);
246  void EnterGrayoutMode();
247  void ExitGrayoutMode();
248  bool IsGrayoutMode() const;
249  void EnterDuplicateMode();
250  void ExitDuplicateMode();
251  bool IsDuplicateMode() const;
252 
253  void hCalculateInnerStrokeForConsectivePieSlice(TripleId iTripleId, Int32 lBeginIndex, Int32 lEndIndex);
254  void hHandleHighLightObjects(const std::vector<TripleId>& irTripleIds);
255  void hAddRedrawObjectsInHighLightView(const LayerObject::Ptr &iHighLightLayerObjectPtr, const TripleId& iTripleId);
256  void hDeleteRedrawObjectsInHighLightView(const LayerObject::Ptr &iHighLightLayerObjectPtr, const TripleId& iTripleId);
257  void SetChartOffset(Int32 iXOffset, Int32 iYOffset);
258  void HighlightOrHideOneObject(const TripleId irTripleId, bool iIsHide);
259  void HighlightOrHideObjects(const std::vector<TripleId>& irTripleIds, bool iIsHide);
261  void HighlightSelectedInInit(std::vector<std::pair<Int32, Int32> >& iSelectedSeriesAndColumns);
262 #ifndef _VE_CE
263  void GetAllGraphObjectInfo(std::vector<CGRect> &iAllGraphObjectsBorder, std::vector<MsiChart::TripleId > &iAllGraphObjectsTripleId);
264 #endif
265  void SetGMZoomScale(float iHeightScale, float iWidthScase);
266 
268  void SetGMCEContext(void* iGMCEContext);
269  void RefreshOnDataChange();
271  bool IsDataEnough();
272  float GetMemoryUsageEstimation();
273  void SetFontScale(double iRatio = 1.0);
274  void SetTemplateNode(DSSRWTemplateNode* ipTemplateNode);
275  double GetPositionAtTick(double iTickValue, bool iIsForXAxis, Int32 iGraphDimentionLength);
276  void SetEntireness(bool iIsEntireChart);
277  Int32 GetIntervalSpace(bool iIsXAxis);
278  bool IsZeroBaseLineQualified(bool iIsXAxis, bool isSecondaryAxis);
279  void DisableAnimationForZoom(bool iDisableAnimation);
280  bool GetGroupSpace(std::vector<Int32>& orVect, Int32 iGroupIndex, bool iIsLegned = false);
281  bool GetSpaceAt(std::vector<Int32>& orVect, const TripleId& irObjectId);
282  Int32 GetAxisLabelRotaion(bool iIsXAxis);
283  Int32 LayoutAxis(bool iIsXAxis, bool iIsRotated, Int32& orMaxLabelSpace);
284  bool IsIsolatedDot(const TripleId& irId);
285  bool IsIsolatedDotInLine(const TripleId& irId);
286  bool GetInterlacedBandingPosition(bool iIsXAxis, std::vector<double>& orPostions, bool iIsFromUniformAxis = true);
287  bool RefreshChart(const RefreshPack& irRefreshPack);
288  bool GetDataAreaPadding(std::vector<double>& orPaddings);
289  bool IsInitialized() const;
290  bool IsVerticalChart() const;
291  void SetTextAsShape(bool iFlag);
292  void cleanDataSet();
293 #ifdef _VE_CE
294  bool isSeriesHaveControls() { return mSeriesHaveControls; }
295  bool isGroupsHaveControls() { return mGroupsHaveControls; }
296  bool isHasMetricSelector() { return mHasMetricSelector; }
297 #endif
298  ChartContext* GetChartContext(void) { return mChartContextPtr.Get(); }
299 
300  protected:
301  ~ChartImpl();
302 
303  private:
309  bool hCreateDrawEnv(Int32 iFormat);
310 
316  bool hCreateWin32DrawEnv(HDC iHdc);
317 
321  void hDrawImage();
322 
329  Int32 hGetGraphObjectManagerId(Int32 iPropertyId, Int32 iObjectId);
330 
334  void hLoadProperties();
335 
336  // bool hImageCoordinateToVirtualCoordinate(Int32 iImageX, Int32 iImageY, Int32& orVirtualX, Int32& orVirtualY);
337  //Graph Imaging
338  bool hPlainDraw(Int32 iWidth, Int32 iHeight);
339 
344  void hGetDataGroupAndFlag(Int32& orDataGroup, bool& orFlag) const;
345 
351  bool hGetDataPointForToolTip(GraphObject::Ptr iGraphObjectPtr,Point2D&orDataPoint);
352 
356  Int32 hGetSeriesColorForToolTip(GraphObject::Ptr iGraphObjectPtr);
357 
360  void hUpdateDataset();
361 
366  void hStringToFormat(const wchar_t* lpFormatString, ChartAdvFormat& orFormat);
367 
370  void hClearTooltips();
371 
375  bool hIsXAxisValueAxis();
376 
380  bool hIsYAxisCategoryAxis();
381 
387  bool hOnHover(GraphObject::Ptr iGraphObjectPtr, bool iIsOn = true);
388 
393  Tooltip* hCreateGMTooltipByObject(GraphObject::Ptr iGraphObjectPtr);
394 
399  Tooltip* hCreateBudgetingTooltipByObject(GraphObject::Ptr iGraphObjectPtr);
400 
405  Tooltip* hCreateTooltipByObject(GraphObject::Ptr iGraphObjectPtr);
406 
411  Tooltip* hCreateVITooltipByObject(GraphObject::Ptr iGraphObjectPtr);
412 
418  Tooltip* hGenerateTooltipByObject(GraphObject::Ptr iGraphObjectPtr, bool iPersistent = false);
419 
424  bool hIsTooltipEnabled() const;
425  bool hIsTooltipEnabled(GraphObject::Ptr iGraphObjectPtr) const;
426  bool hIsTooltipEnabled(const TripleId& irId) const;
427 
432  bool hCanShowTooltipByObject(GraphObject::Ptr iGraphObjectPtr, bool iPersistent = false) const;
433 
438  void hUpdateGMCategoryAxisCross(CategoryAxis* ipAxis);
439 
442  void hReplaceNewLineWithSpace(char* ipString) const;
443 
446  int hMinGroupCountByGraphType(Int32 iGraphType);
447 #ifdef _VE_CE
448 
450  bool hIsSelected(short iSID, short iGID, std::vector<std::pair<Int32, Int32> >& iSelectedSeriesAndColumns);
451 #endif
452 
454  std::string hGetResolvedGlobalMacro(const std::string& irGlobalMacro, bool& orIsResolved);
455 
461  void hFilterDuplicationFromList(std::vector<GraphObject::Ptr>& orCandidateObjects, const std::vector<GraphObject::Ptr>& irObjectList, GraphObject::Ptr iObjectPtr, const Point2D& irCursor);
462 
466  void hPrepareTargetObjectIds(std::vector<Int32>& orObjectIds, Int32 iType);
467 
468 
472  bool hIsInObjectIdList(Int32 iObjectId, const std::vector<Int32>& irObjectIdList);
473 
476  void hUpdateHighlightObjectList();
477 
480  Int32 hGetMarginCount();
481 
490  bool hComputePositionById(Int32 iSeriesId, Int32 iGroupId, Int32& orX, Int32& orY);
491 
500  bool hComputePositionByObject(Int32 iSeriesId, Int32 iGroupId, Int32& orX, Int32& orY);
501 
502  bool hIsHistogramChart();
503 
504  /* helper function to GetTooltipDataString.
505  @param iValue, the returned value from GetTooltipDataString
506  @param iPercentValue, the returned percentage from GetTooltipDataString
507  */
508  bool hFormatTooltipDataString(Int32 iSeriesID, Int32 iGroupID, MBase::String& orDataString, Int32 iOffset, double iValue, double iPercentValue, bool isForPercentValue = false, Int32 iAngleId = -3, Int32 iSliceId = -3);
509 
510  Axis* hGetAxis(bool iIsXAxis, bool iIsUniformAxis, bool iIsPrimary = true);
511 
512  bool mFontAntiAlias;
513  std::vector<TripleId> mSelectionList;
514  Dataset::Ptr mDatasetPtr;
515  FormatManager::Ptr mFormatManagerPtr;
516  ChartManager::Ptr mChartManagerPtr;
517  ChartManager::Ptr mOldChartManagerPtr;
518  MSynch::SmartPtr<ChartContext> mChartContextPtr;
519  bool mInitialized;
520 
521  std::vector<Tooltip*> mTooltips;
522 
523  Axis::Ptr mUniformYAxisPtr;
524  Axis::Ptr mUniformXAxisPtr;
525  // Dual Axis Support
526  Axis::Ptr mUniformY2AxisPtr;
527  Axis::Ptr mUniformX2AxisPtr;
528 
529  LayerObject::Ptr mBaseLayerObjectPtr;
530  GraphObject::Ptr mSelectedObjectPtr;
531  GraphObject::Ptr mSelectedLineObjectPtr;
532  DSSRWTemplateNode* mpRWTemplateNode;
533  bool mIsShowHighLightedObj;
534 
535 #ifdef _VE_CE
536  bool mSeriesHaveControls;
537  bool mGroupsHaveControls;
538  bool mHasMetricSelector;
539 #endif
540 
541  // lasso selections
542  std::vector<GraphObject::Ptr> mSelectedObjectsForLassoSelection;
543  };
544 }
545 
546 #endif
void SetFontScale(double iRatio=1.0)
Int32 GetMaxElementRadius(Int32 iWidth, Int32 iHeight, bool iIsPerfectPadding=false)
void SetGraphType(short iGraphType)
Definition: DSSRWTemplateNode.h:19
float GetMemoryUsageEstimation()
Get memory usage estimation before drawing.
void GetAllGraphObjectInfo(std::vector< CGRect > &iAllGraphObjectsBorder, std::vector< MsiChart::TripleId > &iAllGraphObjectsTripleId)
bool IsInitialized() const
bool GetToolTipDataString(Int32 iSeriesID, Int32 iGroupID, MBase::String &orDataString, Int32 iOffset=0)
void SetStaggerLabelStartLevel(Int32 irLabelStartLevel)
void ExitGrayoutMode()
Exit gray out mode.
bool IsVerticalChart() const
void SetIsCategoryXAxisForPartialRendering(bool isForPartialRendering)
void DrawDataAreaForUniformAxis(CGContext *ipCGContext, Int32 iWidth, Int32 iHeight)
Int32 GetDataAreaSplitX() const
void SetTextAsShape(bool iFlag)
bool GenerateImageMap(Int32 iWidth, Int32 iHeight, ImageMap &oImageMap)
void DrawUniformYAxis(CGContext *ipCGContext, Int32 iWidth, Int32 iHeight, bool iIsForSecondaryAxis=false)
void SetTemplateNode(DSSRWTemplateNode *ipTemplateNode)
Int32 GetDataAreaSplitY() const
bool IsInSelectionList(const TripleId &iObject)
bool IsIsolatedDotInLine(const TripleId &irId)
bool IsDuplicateMode() const
bool SaveImageToMemory(Int32 iWidth, Int32 iHeight, Int32 iFormat, char *&oprMemory, unsigned Int32 &orSize)
bool GetNearestObject(Int32 iX, Int32 iY, const std::vector< Int32 > &irObjectIds, Int32 iRadius, TripleId &orNearestTripleId, int *opNearestDistance=NULL)
bool OnHover(Int32 iX, Int32 iY)
bool GetOptions(Int32 iObjectId, Int32 iSeriesId, Int32 iGroupId, Int32 iPropertyId, CComVariant *opValue)
bool GetNearestObjectForGMCombo(Int32 iX, Int32 iY, const std::vector< Int32 > &irObjectIds, Int32 iRadius, TripleId &orNearestTripleId, int *opNearestDistance=NULL)
void EnableVIDocument(bool iIsVIDocument)
Definition: ChartImpl.h:31
void hHandleHighLightObjects(const std::vector< TripleId > &irTripleIds)
bool ClearOneHighlightObject(MsiChart::TripleId iTripleId)
This struct is from ChartCtrl.h.
Definition: NumberObject.h:38
void SetChartOffset(Int32 iXOffset, Int32 iYOffset)
void OnSwipingInZoom(Int32 iX, Int32 iY)
void SetFormatManager(FormatManager::Ptr iFormatManagerPtr)
Set a new FormatManager to current chart.
Int32 GetUniformYAxisWidth(Int32 iYAxisLength, Int32 iMetricIndex=-1, bool iIsForSecondaryAxis=false)
Int32 GetDataGroup(bool &orIgnoreForNoSeriesOrGroup) const
Int32 GetAxisLabelRotaion(bool iIsXAxis)
void SetGMZoomScale(float iHeightScale, float iWidthScase)
Int32 LayoutAxis(bool iIsXAxis, bool iIsRotated, Int32 &orMaxLabelSpace)
Int32 GetCategoryAxisLabelInterval()
void hAddRedrawObjectsInHighLightView(const LayerObject::Ptr &iHighLightLayerObjectPtr, const TripleId &iTripleId)
void HighlightOrHideObjects(const std::vector< TripleId > &irTripleIds, bool iIsHide)
Dataset::Ptr GetData()
void GetStaggerLabelEndLevel(Int32 &orLabelEndLevel)
static bool Initialize()
void DisableAnimationForZoom(bool iDisableAnimation)
double GetGroupIntervalInPixel()
void SetGridGraphViewer(void *ipGridGraphViewer)
void GetSOByLassoSelection(std::vector< std::pair< int, int > > &iObjects)
Get Selected Objects by Lasso Selections.
bool GetPrimaryDataStringForPie(Int32 iSeries, Int32 iGroupID, MBase::String &orDataString, bool iIsForColor, Int32 iColumnOffset=0, bool isPercentValue=false, Int32 iAngleIndex=-3, Int32 iSliceIndex=-3)
Int32 GetSeriesColorFromPalette(Int32 iIndex)
bool IsIsolatedDot(const TripleId &irId)
Definition: Dataset.h:198
void SetGMCEContext(void *iGMCEContext)
int ApplySelectedObjects(Int32 iX, Int32 iY, std::vector< Point2D > &iPoints, Point2D &ioPoint)
bool IsZeroBaseLineQualified(bool iIsXAxis, bool isSecondaryAxis)
bool AdjustingAxisPaddingForDataLabel(Rect2D &iorRect, Int32 iMetricIndex, bool iIsForXAxis, Int32 iAxisLength)
void SetCGContext(CGContext *ipCGContext)
static bool Finalize()
virtual void DisposeSelectionList(TripleId *ipSelectionList)
bool GetToolTipData(Int32 iSeriesID, Int32 iGroupID, double &orValue, double &orPercentValue, Int32 iOffset=0)
bool GetPrimaryDataString(Int32 iSeriesID, Int32 iGroupID, MBase::String &orDataString, bool iIsForColor, Int32 iSizebyIndex=0)
bool ShouldRotateDataLabel(Int32 iWidth, Int32 iHeight, bool iIsForPefectPadding=false)
void SetAnimationDuration(double iSeconds)
Int32 GetChartAreaId(const TripleId &iObject)
bool GetAllObjectsWithInDistance(Int32 iX, Int32 iY, const std::vector< Int32 > &irObjectIds, Int32 iRadius, std::vector< SelectedInfo > &orNearObjects, std::vector< Int32 > &orDistance)
Int32 GetGraphWidth() const
void EnableAnimation(bool iUseAnimation)
Int32 GetGraphHeight() const
void EnableMicroChart(bool iIsMicroChart)
void SetUniformAxisMargins(short iLeftMargin, short iRightMargin, short iTopMargin, short iBottomMargin, bool iIsForSecondaryAxis=false)
void SetTemplateNodeKey(const std::string &irKey)
#define Int32
Definition: BasicTypes.h:20
Definition: Axis.h:123
std::pair< int, std::pair< double, double > > GraphMatrixMinMaxInfo
Definition: Chart.h:48
bool SaveImageToFile(Int32 iWidth, Int32 iHeight, Int32 iFormat, const char *ipFilename)
void ResetGroupRangeAndAxesState(Int32 iBeginGroup, Int32 iEndGroup)
bool AddToSelectionList(const TripleId &iObject)
void SetEntireness(bool iIsEntireChart)
bool GetGroupSpace(std::vector< Int32 > &orVect, Int32 iGroupIndex, bool iIsLegned=false)
Int32 CreateTooltipByObject(TripleId *ipSelectionList, Int32 iNum, std::vector< Tooltip *> &orTooltips, bool iPersistent=false)
bool GetPositionById(Int32 iSeriesId, Int32 iGroupId, Int32 &orX, Int32 &orY)
Int32 GetIntervalSpace(bool iIsXAxis)
virtual void Delete()
void GetUniformAxisMargins(short &orLeftMargin, short &orRightMargin, short &orTopMargin, short &orBottomMargin, bool iIsForSecondaryAxis=false)
bool hAdjustingYAxisPadding(Rect2D &iorRect, std::vector< Int32 > iMetricIndexList, Int32 iYAxisLength)
bool hAdjustingXAxisPadding(Rect2D &iorRect, std::vector< Int32 > iMetricIndexList, Int32 iXAxisLength)
void SetTimeSeriesIntegrity(Int32 iIntegrity)
bool IsDrillableLabelAtCoords(int iX, int iY, std::string &orLinkURL)
void GetGroupLabel(Int32 iGroupId, MBase::String &orGroupLabel, const wchar_t iSeparator, bool iIsAbbreviated)
void DeviceToVirtualPoint(Int32 &iorX, Int32 &iorY) const
void hCalculateInnerStrokeForConsectivePieSlice(TripleId iTripleId, Int32 lBeginIndex, Int32 lEndIndex)
void HideAxisElements(bool iHide)
void GetSeriesLabel(Int32 iSeriesID, MBase::String &orSeriesLabel, bool iSubstitute, Int32 iColumnOffset, bool iIsForSlice)
General image usage.
Definition: Common.h:325
void EnableTimeSeriesChart(bool iIsTimeSeriesChart)
Definition: ChartContext.h:542
void OnZooming(Int32 iOldStart, Int32 iOldEnd, Int32 iNewStart, Int32 iNewEnd, bool iIsVertical)
void SetChartComponent(Int32 iChartComponent)
int GetDataPointForUIMenu(Int32 iX, Int32 iY, Tooltip &ioTooltip, bool iLSMode=false)
std::basic_string< WCHAR, std::char_traits< WCHAR >, Allocator< WCHAR > > String
Definition: BaseString.h:26
Definition: Chart.h:157
void SetXAxisLogicalRange(double iXLogicalStart, double iXLogicalEnd)
void HighlightOrHideOneObject(const TripleId irTripleId, bool iIsHide)
unsigned Int32 GetToolTipByCoords(Int32 iX, Int32 iY, std::vector< Tooltip *> &orTooltips, bool iPersistent=false)
Definition: ABLPlot.h:21
double GetPositionAtTick(double iTickValue, bool iIsForXAxis, Int32 iGraphDimentionLength)
void EnableUniformAxis(GraphMatrixMinMaxInfo yMinMaxInfo, GraphMatrixMinMaxInfo xMinMaxInfo, GraphMatrixMinMaxInfo zMinMaxInfo, Int32 iGraphHeight, GraphMatrixMinMaxInfo y2MinMaxInfo=std::make_pair(-1, std::make_pair(0.0, 0.0)), GraphMatrixMinMaxInfo x2MinMaxInfo=std::make_pair(-1, std::make_pair(0.0, 0.0)))
Definition: CategoryAxis.h:82
std::vector< AreaRec * > ImageMap
Definition: ImageMap.h:99
ChartContext * GetChartContext(void)
Definition: ChartImpl.h:298
bool GetHoveredLineObject(TripleId &orHoveredLineObject, Int32 iIndex=0)
void GetShownNumericTicks(std::set< double > &orTicksSet, bool iIsForXAxis)
void HighlightSelectedInInit(std::vector< std::pair< Int32, Int32 > > &iSelectedSeriesAndColumns)
Highlight selected object when the graph document is opened.
bool SaveImageToCGContext(CGContext *ipCGContext, Int32 iWidth, Int32 iHeight, bool iShowValueAxis=true, Int32 iImageUsage=IU_GENERAL)
void EnterGrayoutMode()
Enter gray out mode.
Tooltip * CreateToolTipBySeriesAndGroup(Int32 iSeriesID, Int32 iGroupID, bool iPersistent=false)
bool GetInterlacedBandingPosition(bool iIsXAxis, std::vector< double > &orPostions, bool iIsFromUniformAxis=true)
void DrawUniformXAxis(CGContext *ipCGContext, Int32 iWidth, Int32 iHeight, bool iIsForSecondaryAxis=false)
bool RefreshChart(const RefreshPack &irRefreshPack)
void OnZoomingByGroupRange(double iStartGroup, double iEndGroup)
bool OnPointDetection(Int32 iX, Int32 iY, bool iSmartSelection, TripleId &orSelectedObject)
virtual void AllocSelectionList(TripleId *&orpSelectionList, Int32 &oNum)
void GetHighlightObjects(std::vector< std::pair< Int32, Int32 > > &orHighlightObjects) const
void __RPC_FAR * HDC
Definition: PDCwtypes.h:459
Definition: Chart.h:50
TextObject::Ptr hCreateExtremeDataLabel(std::vector< Int32 > iMetricIndexList, bool iIsForXAxis)
bool SetOptions(Int32 iObjectId, Int32 iSeriesId, Int32 iGroupId, Int32 iPropertyId, CComVariant *ipValue)
Definition: Msi_ccomvariant.h:24
bool GetPieSliceTooltipDataString(Int32 iSeriesID, Int32 iGroupID, Int32 iAngleID, Int32 iSliceID, Int32 iColumnOffset, MBase::String &orDataString)
void SetCategoryAxisLabelInterval(Int32 irLabelInterval)
Definition: ChartCanvas.h:39
void VirtualToDevicePoint(Int32 &iorX, Int32 &iorY) const
bool GetRowAndColumnIndexByCoords(int iX, int iY, int &orRowIndex, int &orColumnIndex, bool iIsDataCellOnly, int iDistance=-1)
bool GetHoveredObject(TripleId &orHoveredObject, Int32 iIndex=0)
void RefreshGraphMatrixContext()
void SetShowNumbericTicks(std::set< double > &irTicksSet, bool iIsForXAxis)
bool ShouldAdjustValueAxis(Int32 iWidth, Int32 iHeight, double &irAdjustedValue, bool iIsForPefectPadding=false)
void SetData(Dataset::Ptr iDatasetPtr)
ChartImpl(Dataset::Ptr iDatasetPtr)
Int32 GetUniformXAxisHeight(Int32 iXAxisLength, Int32 iMetricIndex=-1, bool iIsForSecondaryAxis=false)
#define NULL
Definition: Null.h:10
Int32 GetCachedMaxElementSize()
void EnableVoiceOver(bool iIsVoiceOverMode)
bool IsGrayoutMode() const
is gray out mode
bool IsDataEnough()
Check whether the data is enough for selected graph type.
bool OnRectangleSelection(Int32 iLeft, Int32 iTop, Int32 iWidth, Int32 iHeight, bool iSmartSelection, TripleId *&orpSelectionList, Int32 &oNum)
bool PlainDraw(Int32 iWidth, Int32 iHeight)
void GetGraphType(short &orGraphType)
void SetCurrentGraphFrame(Int32 iX, Int32 iY, Int32 iWidth, Int32 iHeight)
void HighlightSelectedObject(bool iHighlight, bool iIsForLassoSelction=false)
Highlight selected object.
Definition: Chart.h:35
bool CanShowTooltipById(TripleId &irId) const
void GetAxisNumberFormat(CComVariant *opValue) const
Use four Int32 values to represent a 2D rectangle.
Definition: Rect2D.h:25
bool GetSpaceAt(std::vector< Int32 > &orVect, const TripleId &irObjectId)
bool RemoveFromSelectionList(const TripleId &iObject)
void SetAdvancedChartTypeSupport(bool iAdvancedChartTypeSupport)
bool GetDataAreaPadding(std::vector< double > &orPaddings)
void OnSwipingOutOfZoom(Int32 iOffset)
Definition: Common.h:397
void hDeleteRedrawObjectsInHighLightView(const LayerObject::Ptr &iHighLightLayerObjectPtr, const TripleId &iTripleId)
void EnableGraphMatrix(bool iIsGraphMatrix)
void SetDataAreaSplitX(Int32 iXCoord)
Definition: FormatManager.h:157