Mobile API Reference  MicroStrategy 2019
MsiChart::Legend Class Reference

#include <Legend.h>

Inheritance diagram for MsiChart::Legend:
MsiChart::GraphObjectManager MsiChart::ItemedLegend MsiChart::RangeLegend

Public Types

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

Public Member Functions

 Legend (const TripleId &irTripleId, GraphObjectManager *ipManager, Dataset::Ptr iDatasetPtr, Rect2D iArea)
 
 ~Legend ()
 
virtual void Draw ()
 
virtual void GenerateMapAndList ()
 
virtual void GetOptions (Int32 iPropertyId, CComVariant *opValue) const
 
virtual void GetOptions (Int32 iSeriesId, Int32 iPropertyId, CComVariant *opValue) const
 
virtual bool SetFormatLineOfLegendMarkerLine (FormatLine::Ptr iFormatLine, Int32 iSeriesId, bool iIsLineVertical=false)
 
const Rect2DGetLegendArea ()
 
virtual bool IsByGroup () const
 
virtual void UpdateFormatForLegendMarker (Int32 iIndex, FormatFill::Ptr iFormatFill, FormatLine::Ptr iFormatLine, bool iIsLineAssignedToLegnedMarkerLine=false, bool iIsLineVertical=false)
 
void CalculateFrame (Int32 iWidthMargin, Int32 iHeightMargin, Rect2D &orArea)
 
virtual Int32 GetItemCount ()
 
EnumLegendType GetType ()
 
- Public Member Functions inherited from MsiChart::GraphObjectManager
 GraphObjectManager (const TripleId &irTripleId, GraphObjectManager *ipManager)
 
virtual ~GraphObjectManager ()
 
void GetTripleId (TripleId &orTripleId) const
 
virtual GraphObject::Ptr OnPointDetection (const Point2D &irCursor) 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 OnRectangleSelection (const Rect2D &irRect, std::vector< GraphObject::Ptr > &iorSelectedObjects) const
 
virtual void GenerateView ()
 
virtual void GenerateImageMap (ImageMap &iorImageMap)
 
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

virtual Int32 hGetLegendPosition ()
 
- 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
 Pointer to the dataset. More...
 
Rect2D mLegendArea
 Indicates the legend area. More...
 
Rect2D mArea
 Indicates the area excluding title, subtitle, footnote. More...
 
EnumLegendType mType
 Legend Type. More...
 
- 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
 

Detailed Description

This class delegates the chart legend. It is responsible for managing several TextObjects delegating the legend texts and several MarkerObjects delegating the legend area and the legend markers.

Member Typedef Documentation

◆ Ptr

Constructor & Destructor Documentation

◆ Legend()

MsiChart::Legend::Legend ( const TripleId irTripleId,
GraphObjectManager ipManager,
Dataset::Ptr  iDatasetPtr,
Rect2D  iArea 
)

◆ ~Legend()

MsiChart::Legend::~Legend ( )

Member Function Documentation

◆ CalculateFrame()

void MsiChart::Legend::CalculateFrame ( Int32  iWidthMargin,
Int32  iHeightMargin,
Rect2D orArea 
)

This function is to calculate the frame area.

Parameters
iWidthMarginThe width margin between frame and legend.
iHeightMarginThe height margin between frame and legend.
iorAreaUutput is the area for frame.

◆ Draw()

virtual void MsiChart::Legend::Draw ( )
virtual

This function is the drawing function for all graph object. Draw all the GraphObject in the GraphObject list which maintained by current GraphObjectManager.

Reimplemented from MsiChart::GraphObjectManager.

Reimplemented in MsiChart::ItemedLegend, and MsiChart::RangeLegend.

◆ GenerateMapAndList()

virtual void MsiChart::Legend::GenerateMapAndList ( )
virtual

This function generates GraphObjectMap and GraphObjectList.

Implements MsiChart::GraphObjectManager.

Reimplemented in MsiChart::ItemedLegend, and MsiChart::RangeLegend.

◆ GetItemCount()

virtual Int32 MsiChart::Legend::GetItemCount ( )
virtual

This method will return how many items thie legend have. For Range legend it will return 0;

Returns
the item number.

Reimplemented in MsiChart::ItemedLegend.

◆ GetLegendArea()

const Rect2D& MsiChart::Legend::GetLegendArea ( )

This function returns the legend area.

Returns
The legend area.

◆ GetOptions() [1/2]

virtual void MsiChart::Legend::GetOptions ( Int32  iPropertyId,
CComVariant opValue 
) const
virtual

◆ GetOptions() [2/2]

virtual void MsiChart::Legend::GetOptions ( Int32  iSeriesId,
Int32  iPropertyId,
CComVariant opValue 
) const
virtual

This function gets the options related to current GraphObjectManager.

Parameters
iSeriesIdSeries ID.
iPropertyIdSpecifies the property ID to be set.
opValueA pointer to VARIANT which is used to store property value.

Implements MsiChart::GraphObjectManager.

Reimplemented in MsiChart::ItemedLegend, and MsiChart::RangeLegend.

◆ GetType()

EnumLegendType MsiChart::Legend::GetType ( )
inline

◆ hGetLegendPosition()

virtual Int32 MsiChart::Legend::hGetLegendPosition ( )
protectedvirtual

This function is to return the legend position.

Reimplemented in MsiChart::ItemedLegend.

◆ IsByGroup()

virtual bool MsiChart::Legend::IsByGroup ( ) const
virtual

This function tells if the items are listed across groups or series.

Returns
True means the items are from each group.

Reimplemented in MsiChart::ItemedLegend.

◆ SetFormatLineOfLegendMarkerLine()

virtual bool MsiChart::Legend::SetFormatLineOfLegendMarkerLine ( FormatLine::Ptr  iFormatLine,
Int32  iSeriesId,
bool  iIsLineVertical = false 
)
virtual

This function sets FormatLine of the lines behind the legend markers. These kind of lines only exist in Line and Scatter chart.

Returns
True means FormatLine is set successfully and false means not.

Reimplemented in MsiChart::ItemedLegend.

◆ UpdateFormatForLegendMarker()

virtual void MsiChart::Legend::UpdateFormatForLegendMarker ( Int32  iIndex,
FormatFill::Ptr  iFormatFill,
FormatLine::Ptr  iFormatLine,
bool  iIsLineAssignedToLegnedMarkerLine = false,
bool  iIsLineVertical = false 
)
virtual

This function is used to update the format fill for the indexed legend marker (if it has format fill) and format line.

Parameters
iIndex,theindex of the target legend marker.
iFormatFill,thenewly assigned format fill
iFormatLine,thenewly assigned format line.

Reimplemented in MsiChart::ItemedLegend.

Member Data Documentation

◆ mArea

Rect2D MsiChart::Legend::mArea
protected

Indicates the area excluding title, subtitle, footnote.

◆ mDatasetPtr

Dataset::Ptr MsiChart::Legend::mDatasetPtr
protected

Pointer to the dataset.

◆ mLegendArea

Rect2D MsiChart::Legend::mLegendArea
protected

Indicates the legend area.

◆ mType

EnumLegendType MsiChart::Legend::mType
protected

Legend Type.