Mobile API Reference  MicroStrategy 2019
MsiChart::Plot Class Reference

#include <Plot.h>

Inheritance diagram for MsiChart::Plot:
MsiChart::GraphObjectManager MsiChart::CategoryPlot MsiChart::FunnelPlot MsiChart::GaugePlot MsiChart::GridBasePlot MsiChart::HistogramPlot MsiChart::PiePlot MsiChart::PolarPlot MsiChart::ValueBasePlot

Public Types

typedef MSynch::SmartPtr< PlotPtr
 
- Public Types inherited from MsiChart::GraphObjectManager
typedef MSynch::SmartPtr< GraphObjectManagerPtr
 

Public Member Functions

 Plot (const TripleId &irTripleId, GraphObjectManager *ipManager, const Rect2D &irDataArea)
 
virtual ~Plot ()
 
virtual void Draw ()
 
virtual void GenerateView ()
 
virtual void GenerateImageMap (ImageMap &iorImageMap)
 
virtual GraphObject::Ptr OnPointDetection (const Point2D &irCursor) const
 
virtual void OnRectangleSelection (const Rect2D &irRect, std::vector< GraphObject::Ptr > &iorSelectedObjects) const
 
virtual bool GetToolTipData (Int32 iSeriesID, Int32 iGroupID, double &orValue, double &orPercentValue, Int32 iOffset=0)
 
virtual bool GetGroupSpace (std::vector< Int32 > &orVect, Int32 iGroupIndex)
 
virtual Int32 GetMaxElementRadius ()
 
virtual void RefreshValueAxis (const std::map< Int32, std::pair< double, double > > &irScaleSet, const Rect2D &irRect)
 
virtual bool GetMaxElementOffsetClippedByBoundary (bool iIsOnXAxis, double &orLowOffset, double &orHighOffset)
 
virtual bool GetGMPiePositon (Point2D &orCood, double iXInput, double iYInput, Int32 iXSubIndex=0, Int32 iYSubIndex=0, Int32 iXSectionCount=1, Int32 iYSectionCount=1, Int32 iRadius=2)
 
virtual void DrawTrendLinesAndEquations ()
 Draw trendlines and equations. More...
 
void GetDataArea (Rect2D &orDataArea) const
 
void SetDataArea (const Rect2D &irDataArea)
 
Dataset::Ptr GetDataset () const
 
Legend::Ptr GetLegend () const
 
void SetDataset (Dataset::Ptr iDataSetPtr)
 
void SetLegend (Legend::Ptr iLegendPtr)
 
void AddSeries (Int32 iSeriesId)
 
Int32 GetSeriesIndexByID (Int32 iSeriesId) const
 
void MoveLabel (TextObject *ipTextObject, const Point2D &irTopRight, const Point2D &irBottomLeft, bool iIsReverse, bool iIsVertical, EnumDSSGraphDataTextPosition iLabelLocation) const
 
void AddLegendMarkerToCollection (Int32 iSeriesId, GraphCollectionObject *ipRiserCollection, bool iIsLineCollection=false, bool iIsShownMarker=true, unsigned char iMarkerShape=DssGraphMarkerShapeRectangle, bool iIsShownLine=true, bool iIsLineVertical=false) const
 
void CreateTrendLine (const std::vector< double > &irX, const std::vector< double > &irY, const TripleId &irTripleId, GraphObjectManager *ipManager, GraphCollectionObject *ipParentObject, Axis *ipXAxis, Axis *ipYAxis, GraphTrendLineOptions *ipTrendLineOptions, const Rect2D &irDataArea, bool iIsVertical, const Point2D &irDepthOffset, bool iIsY2=false)
 
void AdjustTrendLineEquation (Rect2D &irRect, EnumTrendLineIndex iIndex)
 
void DrawTrendLinesAndEquations (Rect2D &irClipRect, bool iIsY2=false)
 
void DrawPostTrendLineObjects ()
 
void GeneratePostTrendLineViews ()
 
bool HasTrendLines () const
 
void AddTrendLineAnadRefLine (GraphObject::Ptr iLine)
 
DataLabelManager::Ptr GetDataLabelManager ()
 
bool GetVAMetricIndexDrawn (Int32 iValueMetricIndex)
 
void SetVAMetricIndexDrawn (Int32 iValueMetricIndex)
 
- Public Member Functions inherited from MsiChart::GraphObjectManager
 GraphObjectManager (const TripleId &irTripleId, GraphObjectManager *ipManager)
 
virtual ~GraphObjectManager ()
 
void GetTripleId (TripleId &orTripleId) const
 
virtual GraphObject::Ptr OnPointDetectionEx (const Point2D &irCursor, const std::vector< Int32 > &irObjectIds, Int32 &iorDistance, Int32 iRadius, std::vector< GraphObject::Ptr > &iorGraphObjectsAround, EnumGraphObjectUsage iUsage=GOU_NORMAL_HIGHLIGHT)
 
virtual void OnPointInPolygon (const Point2D &irCursor, const std::vector< Int32 > &irObjectIds, const std::vector< Point2D > &iPoints, std::vector< GraphObject::Ptr > &iorGraphObjectsIn) const
 
virtual void GenerateMapAndList ()=0
 
virtual void GetOptions (Int32 iSeriesId, Int32 iPropertyId, CComVariant *opValue) const =0
 
virtual GraphObject::Ptr GetGraphObject (const TripleId &irTripleId, bool iRecursive=true) const
 
GraphObjectManager::Ptr GetGraphObjectManager (const TripleId &irTripleId, bool iRecursive=true) const
 
void GetAllGraphObjectInfo (std::vector< CGRect > &iAllGraphObjectsBorder, std::vector< MsiChart::TripleId > &iAllGraphObjectsTripleId)
 
virtual void GenerateVirtualMarker ()
 
ChartContext::Ptr GetChartContext () const
 
Int32 GetChartAreaId () const
 
void AddToMapAndList (GraphObject::Ptr iGraphObjectPtr)
 
void AddToMapAndList (std::vector< GraphObject::Ptr > iGraphObjectPtrList)
 
void AddToList (GraphObject::Ptr iGraphObjectPtr)
 
void AddToManagerList (GraphObjectManager::Ptr iGraphObjectPtr)
 
void AddToMap (GraphObject::Ptr iGraphObjectPtr)
 
void InsertGraphObjectListAfterObject (const std::vector< GraphObject::Ptr > &irGraphObjectList, const GraphObject *ipGraphObject)
 
virtual void GenerateInterpolationFrame (double iProgress, LayerObject *ipLayerObject)
 
void MergeObjectList (GraphObjectManager *ipGraphObjectManager, bool iIsAppend)
 
void GetGraphObjectList (std::vector< GraphObject::Ptr > &orGraphObjectList)
 Get GraphObject list. More...
 
void GetGraphObjectManagerList (std::vector< GraphObjectManager::Ptr > &orGraphObjectManagerList)
 Get GraphObjectManager list. More...
 
void ClearGraphObjectList ()
 Clear GraphObject list. More...
 
float GetMemoryUsageEstimation () const
 Get memory usage estimation for current GraphObjectManager. More...
 
void ExtractGraphObjectsByObjectId (std::vector< GraphObject::Ptr > &orGraphObjectList, Int32 iObjectId)
 Extract some graph objects out by object ID. The extracted graph object will be removed from mGraphObjectList. More...
 

Protected Member Functions

void LoadTrendLineProperties (Int32 iSeriesId, GraphTrendLineOptions &iorTrendLineOption) const
 
void LoadValueAxisInfo (Int32 iSeriesIndex, bool iIsDualAxes, EnumValueAxis &orValueAxis) const
 
- Protected Member Functions inherited from MsiChart::GraphObjectManager
bool ToBool (CComVariant *ipValue) const
 
void BoolToVariant (bool iValue, CComVariant *opValue) const
 
void AdjustObjectsForLayer ()
 

Protected Attributes

Dataset::Ptr mDatasetPtr
 
Legend::Ptr mLegendPtr
 
std::vector< Int32mGroupID
 
std::vector< Int32mSeriesId
 
Rect2D mDataArea
 
std::vector< TrendLineObject::PtrmTrendLines [2]
 
std::vector< GraphObject::PtrmPostTrendLineObjects
 
DataLabelManager::Ptr mLabelManager
 
bool mVAIndexDrawn [5]
 
std::set< Int32mVAIndexDrawnSet
 
- Protected Attributes inherited from MsiChart::GraphObjectManager
std::map< TripleId, GraphObject::PtrmGraphObjectMap
 
std::vector< GraphObject::PtrmGraphObjectList
 
std::vector< GraphObjectManager::PtrmGraphObjectManagerList
 This list keeps all the children of current GraphObjectManager. More...
 
const TripleId mTripleId
 Identifiy current GraphObjectManager. More...
 
ChartContext::Ptr mChartContextPtr
 The drawing context instance. Only one object in a chart. More...
 
GraphObjectManagermpManager
 The manager object which created the current object. More...
 
double mProgress
 
LayerObjectmpCurrentLayerObject
 

Additional Inherited Members

- Static Public Member Functions inherited from MsiChart::GraphObjectManager
static GraphObject::Ptr OnPointDetectionByList (const std::vector< GraphObject::Ptr > &irGraphObjectList, const Point2D &irCursor, const std::vector< Int32 > &irObjectIds, Int32 &iorDistance, Int32 iRadius, std::vector< GraphObject::Ptr > &iorGraphObjectsAround, EnumGraphObjectUsage iUsage=GOU_NORMAL_HIGHLIGHT)
 
- Protected Types inherited from MsiChart::GraphObjectManager
typedef std::pair< TripleId, GraphObject::PtrMapPair
 

Member Typedef Documentation

◆ Ptr

Constructor & Destructor Documentation

◆ Plot()

MsiChart::Plot::Plot ( const TripleId irTripleId,
GraphObjectManager ipManager,
const Rect2D irDataArea 
)

◆ ~Plot()

virtual MsiChart::Plot::~Plot ( )
virtual

Member Function Documentation

◆ AddLegendMarkerToCollection()

void MsiChart::Plot::AddLegendMarkerToCollection ( Int32  iSeriesId,
GraphCollectionObject ipRiserCollection,
bool  iIsLineCollection = false,
bool  iIsShownMarker = true,
unsigned char  iMarkerShape = DssGraphMarkerShapeRectangle,
bool  iIsShownLine = true,
bool  iIsLineVertical = false 
) const

As the name, add legend marker to the collection they belong to.

Parameters
iSeriesIdThe input series ID.
ipRiserCollectionThe input collection.
iIsLineCollectionIndicate whether it is line collection, true for line chart.
iMarkerShapeIndicate the marker shape.
iIsShownLineIndicate whether the lines are shown or not.

◆ AddSeries()

void MsiChart::Plot::AddSeries ( Int32  iSeriesId)
inline

Add a series to the category plot

Parameters
iSeriesIdThe input series ID.

◆ AddTrendLineAnadRefLine()

void MsiChart::Plot::AddTrendLineAnadRefLine ( GraphObject::Ptr  iLine)

◆ AdjustTrendLineEquation()

void MsiChart::Plot::AdjustTrendLineEquation ( Rect2D irRect,
EnumTrendLineIndex  iIndex 
)

Adjust trend line equation position.

Parameters
irRectThe rectangle trend lines should be in.
iIndexIndicate which trend line collection we would like to adjust, Y1, Y2 or Both.

◆ CreateTrendLine()

void MsiChart::Plot::CreateTrendLine ( const std::vector< double > &  irX,
const std::vector< double > &  irY,
const TripleId irTripleId,
GraphObjectManager ipManager,
GraphCollectionObject ipParentObject,
Axis ipXAxis,
Axis ipYAxis,
GraphTrendLineOptions ipTrendLineOptions,
const Rect2D irDataArea,
bool  iIsVertical,
const Point2D irDepthOffset,
bool  iIsY2 = false 
)

Create a trend line, add it to collection and update the format line information if necessary.

Parameters
irXThe input sample point X coordinate.
irYThe input sample point Y coordinate.
irTripleIdThe input triple ID for trend line.
ipManagerIndicate the manager to create the trend line.
ipParentObjectIndicate the parent of the trend line.
ipXAxisIndicate the axis where we get the irX.
ipYAxisIndicate the axis where we get the irY.
ipTrendLineOptionsThe input trend line option.
irDataAreaThe input data area.
iIsVerticalIndicate whether the chart is vertical or horizontal.
irDepthOffsetThe input depth information.
iIsY2Indicate whether the trend line belongs to Y1 or Y2.

◆ Draw()

virtual void MsiChart::Plot::Draw ( )
virtual

◆ DrawPostTrendLineObjects()

void MsiChart::Plot::DrawPostTrendLineObjects ( )

Draw objects in mPostTrendLineObjects.

◆ DrawTrendLinesAndEquations() [1/2]

virtual void MsiChart::Plot::DrawTrendLinesAndEquations ( )
virtual

Draw trendlines and equations.

Reimplemented in MsiChart::ABLPlot.

◆ DrawTrendLinesAndEquations() [2/2]

void MsiChart::Plot::DrawTrendLinesAndEquations ( Rect2D irClipRect,
bool  iIsY2 = false 
)

Draw trend lines and their equations.

Parameters
irClipRectThe rectangle which is used to clip the trend line.
iIsY2Indicate whether draw trend line for Y1 or Y2.

◆ GenerateImageMap()

virtual void MsiChart::Plot::GenerateImageMap ( ImageMap iorImageMap)
virtual

This function is to generate the image map for the web.

Parameters
ioImageMapInput and output parameter which contains the image map.

Reimplemented from MsiChart::GraphObjectManager.

Reimplemented in MsiChart::ABLPlot, MsiChart::ValuePlot, MsiChart::GaugePlot, MsiChart::HistogramPlot, MsiChart::GridPlot, MsiChart::ValuePiePlot, CategoryPiePlot, and MsiChart::GridPiePlot.

◆ GeneratePostTrendLineViews()

void MsiChart::Plot::GeneratePostTrendLineViews ( )

Generate UIViews for objects in mPostTrendLineObjects.

◆ GenerateView()

virtual void MsiChart::Plot::GenerateView ( )
virtual

Generate UIViews for drawing. The UIViews generation is seperated from Draw() and put here to optimize the workflow and support Memory Governor's work. This function has the same workflow as Draw(), which means either function is changed, the other one has to update its workflow too. All the inheriting classes has to ensure this restriction too.

Reimplemented from MsiChart::GraphObjectManager.

Reimplemented in MsiChart::ABLPlot, MsiChart::PiePlot, MsiChart::FunnelPlot, MsiChart::ValuePlot, MsiChart::GaugePlot, MsiChart::HistogramPlot, MsiChart::PolarPlot, and MsiChart::GanttPlot.

◆ GetDataArea()

void MsiChart::Plot::GetDataArea ( Rect2D orDataArea) const

Get the data area for the plot.

Parameters
orDataAreaThe output data area.

◆ GetDataLabelManager()

DataLabelManager::Ptr MsiChart::Plot::GetDataLabelManager ( )
inline

◆ GetDataset()

Dataset::Ptr MsiChart::Plot::GetDataset ( ) const
inline

Get dataset pointer.

Returns
The dataset pointer.

◆ GetGMPiePositon()

virtual bool MsiChart::Plot::GetGMPiePositon ( Point2D orCood,
double  iXInput,
double  iYInput,
Int32  iXSubIndex = 0,
Int32  iYSubIndex = 0,
Int32  iXSectionCount = 1,
Int32  iYSectionCount = 1,
Int32  iRadius = 2 
)
virtual

◆ GetGroupSpace()

virtual bool MsiChart::Plot::GetGroupSpace ( std::vector< Int32 > &  orVect,
Int32  iGroupIndex 
)
virtual

Reimplemented in MsiChart::PiePlot.

◆ GetLegend()

Legend::Ptr MsiChart::Plot::GetLegend ( ) const
inline

Get legend pointer.

Returns
The legend pointer.

◆ GetMaxElementOffsetClippedByBoundary()

virtual bool MsiChart::Plot::GetMaxElementOffsetClippedByBoundary ( bool  iIsOnXAxis,
double &  orLowOffset,
double &  orHighOffset 
)
virtual

Reimplemented in MsiChart::ValuePlot.

◆ GetMaxElementRadius()

virtual Int32 MsiChart::Plot::GetMaxElementRadius ( )
virtual

◆ GetSeriesIndexByID()

Int32 MsiChart::Plot::GetSeriesIndexByID ( Int32  iSeriesId) const

Get the series index by series ID. We do a binary search in mSeriesId since it is ordered vector.

Parameters
iSeriesIdThe input series ID.
Returns
The series index

◆ GetToolTipData()

virtual bool MsiChart::Plot::GetToolTipData ( Int32  iSeriesID,
Int32  iGroupID,
double &  orValue,
double &  orPercentValue,
Int32  iOffset = 0 
)
virtual

◆ GetVAMetricIndexDrawn()

bool MsiChart::Plot::GetVAMetricIndexDrawn ( Int32  iValueMetricIndex)
inline

◆ HasTrendLines()

bool MsiChart::Plot::HasTrendLines ( ) const
inline

◆ LoadTrendLineProperties()

void MsiChart::Plot::LoadTrendLineProperties ( Int32  iSeriesId,
GraphTrendLineOptions iorTrendLineOption 
) const
protected

Load the trend line properties for series specified by iSeriesId.

Parameters
iSeriesIdThe input series ID.
iorTrendLineOptionThe input and output trend line option.

◆ LoadValueAxisInfo()

void MsiChart::Plot::LoadValueAxisInfo ( Int32  iSeriesIndex,
bool  iIsDualAxes,
EnumValueAxis orValueAxis 
) const
protected

Load the value axis information for each series.

Parameters
iSeriesIndexThe input series index.
iIsDualAxesIndicate whether it is dual axis or not.
orValueAxisThe output reference to value axis variable.

◆ MoveLabel()

void MsiChart::Plot::MoveLabel ( TextObject ipTextObject,
const Point2D irTopRight,
const Point2D irBottomLeft,
bool  iIsReverse,
bool  iIsVertical,
EnumDSSGraphDataTextPosition  iLabelLocation 
) const

Move the labels.

Parameters
ipTextObjectThe input text object that is to be moved.
irTopRightThe top or right point according to the new center point.
irBottomLeftThe bottom or left point according to the new center point.
iIsReverseIndicate whether reverse, two things will affect this: Axis reverse and data negative or positive.
iIsVerticalIndicate whether the chart is vertical or horizontal.
iLabelLocationIndicate the label position.
iSmart,whetheruse smart label or not.

◆ OnPointDetection()

virtual GraphObject::Ptr MsiChart::Plot::OnPointDetection ( const Point2D irCursor) const
virtual

Provided the cursor coordinate, this function returns the GraphObject which contains that coordinate. If there are more then one GraphObject contains this coordinate, the one on top layer will be returned.

Parameters
irCursorThe coordinate of cursor.
Returns
Smart pointer to the selected object. NULL if no selected object is found.

Reimplemented from MsiChart::GraphObjectManager.

Reimplemented in MsiChart::ABLPlot, MsiChart::PiePlot, MsiChart::FunnelPlot, MsiChart::ValuePlot, MsiChart::GaugePlot, MsiChart::HistogramPlot, MsiChart::GridPlot, MsiChart::GanttPlot, MsiChart::ValuePiePlot, CategoryPiePlot, and MsiChart::GridPiePlot.

◆ OnRectangleSelection()

virtual void MsiChart::Plot::OnRectangleSelection ( const Rect2D irRect,
std::vector< GraphObject::Ptr > &  iorSelectedObjects 
) const
virtual

This function provides the rectangle hit test detection service. Provided a bounding rectangle, this function can tell all the object inside that area by the parameter ioSelectedObjects.

Parameters
irRectSpecifies the bounding rectangle.
iorSelectedObjectsTo store the pointers of the selected objects. This function will append the smart pointer of each selected GraphObject in current GraphObjectCreater to ioSelectedObjects.

Reimplemented from MsiChart::GraphObjectManager.

Reimplemented in MsiChart::PiePlot, MsiChart::ValuePlot, MsiChart::HistogramPlot, MsiChart::GridPlot, MsiChart::ValuePiePlot, and MsiChart::GridPiePlot.

◆ RefreshValueAxis()

virtual void MsiChart::Plot::RefreshValueAxis ( const std::map< Int32, std::pair< double, double > > &  irScaleSet,
const Rect2D irRect 
)
virtual

Reimplemented in MsiChart::ValuePlot.

◆ SetDataArea()

void MsiChart::Plot::SetDataArea ( const Rect2D irDataArea)

Set the data area for the plot.

Parameters
irDataAreaThe input data area.

◆ SetDataset()

void MsiChart::Plot::SetDataset ( Dataset::Ptr  iDataSetPtr)
inline

Set dataset to plot.

Parameters
iLegendPtrThe input dataset pointer.

◆ SetLegend()

void MsiChart::Plot::SetLegend ( Legend::Ptr  iLegendPtr)
inline

Set legend to plot.

Parameters
iLegendPtrThe input legend pointer.

◆ SetVAMetricIndexDrawn()

void MsiChart::Plot::SetVAMetricIndexDrawn ( Int32  iValueMetricIndex)
inline

Member Data Documentation

◆ mDataArea

Rect2D MsiChart::Plot::mDataArea
protected

◆ mDatasetPtr

Dataset::Ptr MsiChart::Plot::mDatasetPtr
protected

◆ mGroupID

std::vector<Int32> MsiChart::Plot::mGroupID
protected

◆ mLabelManager

DataLabelManager::Ptr MsiChart::Plot::mLabelManager
protected

◆ mLegendPtr

Legend::Ptr MsiChart::Plot::mLegendPtr
protected

◆ mPostTrendLineObjects

std::vector<GraphObject::Ptr> MsiChart::Plot::mPostTrendLineObjects
protected

◆ mSeriesId

std::vector<Int32> MsiChart::Plot::mSeriesId
protected

◆ mTrendLines

std::vector<TrendLineObject::Ptr> MsiChart::Plot::mTrendLines[2]
protected

◆ mVAIndexDrawn

bool MsiChart::Plot::mVAIndexDrawn[5]
protected

◆ mVAIndexDrawnSet

std::set<Int32> MsiChart::Plot::mVAIndexDrawnSet
protected