Provides simple pie chart creation tools. More...

#include <HGraph.h>

Public Member Functions

int AddPieSlice (double size)
 
void AddPieSliceLabel (int slice_id, const char *str)
 
void AddPieSliceUnicodeLabel (int slice_id, const unsigned short *str)
 
void GetPieColorMap (char *map)
 
void GetPieColorMapByValue (int *count, HPoint values[], char *color_space)
 
void GetPieEdgeColor (char *color)
 
bool GetPieEdgeVisibility ()
 
double GetPieRadius ()
 
void GetPieSliceLabelContents (int slice_id, char *str)
 
void GetPieSliceLabelTextFont (int slice_id, char *font)
 
void GetPieSliceUnicodeLabelContents (int slice_id, unsigned short *str)
 
 HPieChart (HC_KEY plot_seg)
 
void RemovePieSlice (int slice_id)
 
void RemovePieSliceLabel (int slice_id)
 
void SetPieColorMap (const char *map)
 
void SetPieColorMapByValue (int count, const HPoint values[], const char *color_space=0)
 
void SetPieEdgeColor (const char *color)
 
void SetPieEdgeVisibility (bool vis)
 
void SetPieRadius (double radius)
 
void SetPieSliceLabelTextFont (int slice_id, const char *font)
 
void SetPlotOrigin (HPoint origin)
 
void SetPlotTitle (const char *title)
 
void SetPlotUnicodeTitle (unsigned short *title)
 
virtual void Update ()
 
virtual ~HPieChart ()
 
- Public Member Functions inherited from HBaseGraph
int AddLabel (const char *str, HPoint loc, HGraphPointFormat format=PointFormatCartesian, float xvector=1.0, float yvector=0.0, float zvector=0.0)
 
void AddLegend (HPoint loc, HGraphPointFormat format=PointFormatCartesian)
 
int AddLegendEntry (const char *str, const char *color, HGraphLegendEntryType ltype=LegendEntryTypeLine)
 
int AddLegendUnicodeEntry (const unsigned short *str, const char *color, HGraphLegendEntryType ltype=LegendEntryTypeLine)
 
int AddUnicodeLabel (const unsigned short *str, HPoint loc, HGraphPointFormat format=PointFormatCartesian, float xvector=1.0, float yvector=0.0, float zvector=0.0)
 
void ConvertPoints (unsigned int in_count, const HPoint in_points[], HGraphPointFormat in_system, HPoint out_points[], HGraphPointFormat out_system)
 
bool GetAutomaticUpdates ()
 
void GetFrameColor (char *color)
 
void GetFramePattern (char *pattern)
 
bool GetFrameVisibility ()
 
float GetFrameWeight ()
 
void GetLabelContents (int label_id, char *str)
 
HPoint GetLabelLocation (int label_id)
 
void GetLabelTextAlignment (int label_id, char *alignment)
 
void GetLabelTextColor (int label_id, char *color)
 
void GetLabelTextFont (int label_id, char *font)
 
void GetLabelTextPath (int label_id, float *xvector, float *yvector, float *zvector)
 
void GetLabelUnicodeContents (int label_id, unsigned short *str)
 
void GetLegendEntry (int entry_id, char *str, char *color, HGraphLegendEntryType *entry_type=0)
 
HPoint GetLegendLocation ()
 
void GetLegendTextFont (char *font)
 
void GetLegendTitle (char *title)
 
void GetLegendTitleTextFont (char *font)
 
void GetLegendUnicodeEntry (int entry_id, unsigned short *str, char *color, HGraphLegendEntryType *entry_type=0)
 
void GetLegendUnicodeTitle (unsigned short *title)
 
HPoint GetPlotOrigin ()
 
void GetPlotTitle (char *title)
 
virtual void GetPlotTitleColor (char *color)
 
HPoint GetPlotTitleLocation ()
 
void GetPlotTitleTextFont (char *font)
 
void GetPlotUnicodeTitle (unsigned short *title)
 
 HBaseGraph (HC_KEY plot_seg)
 
void PreserveData (bool preserve=true)
 
void RemoveLabel (int label_id)
 
void RemoveLegend ()
 
void RemoveLegendEntry (int entry_id)
 
void RemoveLegendTitle ()
 
void SetAutomaticUpdates (bool automatic=true)
 
void SetFrameColor (const char *color)
 
void SetFramePattern (const char *pattern)
 
void SetFrameVisibility (bool visible)
 
void SetFrameWeight (float weight)
 
void SetLabelContents (int label_id, const char *str)
 
void SetLabelLocation (int label_id, HPoint loc, HGraphPointFormat format=PointFormatCartesian)
 
void SetLabelTextAlignment (int label_id, const char *alignment)
 
void SetLabelTextColor (int label_id, const char *color)
 
void SetLabelTextFont (int label_id, const char *font)
 
void SetLabelTextPath (int label_id, float xvector, float yvector, float zvector)
 
void SetLabelUnicodeContents (int label_id, const unsigned short *str)
 
void SetLegendLocation (HPoint loc, HGraphPointFormat format=PointFormatCartesian)
 
void SetLegendTextFont (const char *font)
 
void SetLegendTitle (const char *title)
 
void SetLegendTitleTextFont (const char *font)
 
void SetLegendUnicodeTitle (const unsigned short *title)
 
void SetPlotOrigin (HPoint origin)
 
virtual void SetPlotTitleColor (const char *color)
 
void SetPlotTitleLocation (HPoint loc)
 
void SetPlotTitleTextFont (const char *font)
 
virtual ~HBaseGraph ()
 

Protected Member Functions

virtual void DrawFrame ()
 
virtual void DrawPie ()
 
- Protected Member Functions inherited from HBaseGraph
virtual void DrawLegend ()
 

Protected Attributes

VArray< HGraphPieSlice * > m_pie
 
double m_pie_total
 
double m_scale
 
- Protected Attributes inherited from HBaseGraph
bool m_automatic_updates
 
bool m_force_update
 
VArray< HGraphLabelNode * > m_labels
 
HGraphLegend m_legend
 
HPoint m_origin
 
HC_KEY m_plot_segment
 
bool m_preserve_data
 
bool m_show_frame
 

Detailed Description

Provides simple pie chart creation tools.

Constructor & Destructor Documentation

◆ HPieChart()

HPieChart::HPieChart ( HC_KEY  plot_seg)

HPieChart Constructor.

Parameters
plot_segThe segment that all graph subsegments will be created beneath.

◆ ~HPieChart()

virtual HPieChart::~HPieChart ( )
virtual

~HPieChart Destructor.

Member Function Documentation

◆ AddPieSlice()

int HPieChart::AddPieSlice ( double  size)

Adds a slice to the pie chart with the given size. Pie slice sizes are automatically tracked and updated.

Parameters
sizeThe size of the pie slice.
Returns
The ID of the pie slice. Can be used to later modify or remove the slice.

◆ AddPieSliceLabel()

void HPieChart::AddPieSliceLabel ( int  slice_id,
const char *  str 
)

Labels a pie slice.

Parameters
slice_idThe pie slice.
strA text string containing the label of the pie slice. Passed by reference always.

◆ AddPieSliceUnicodeLabel()

void HPieChart::AddPieSliceUnicodeLabel ( int  slice_id,
const unsigned short *  str 
)

Add a unicode label for the pie slice given by the slice ID.

Parameters
slice_idThe pie slice.
strA unicode string containing the label of the pie slice. Passed by reference always.

◆ DrawFrame()

virtual void HPieChart::DrawFrame ( )
protectedvirtual

Draws a frame around a graph.

Implements HBaseGraph.

◆ DrawPie()

virtual void HPieChart::DrawPie ( )
protectedvirtual

Updates the pie chart geometry and labels.

◆ GetPieColorMap()

void HPieChart::GetPieColorMap ( char *  map)

Retrieves the color map to be used for the pie chart. Pie slices are colored in the order they are added.

Parameters
mapA text string containing all the colors in the pie chart color map. Returned to user. Passed by reference always.

◆ GetPieColorMapByValue()

void HPieChart::GetPieColorMapByValue ( int *  count,
HPoint  values[],
char *  color_space 
)

Sets the color map by value to be used for the pie chart. Pie slices are colored in the order they are added.

Parameters
countThe number of colors in the values array. Returned to user. Passed by reference always.
valuesAn array of HPoints containing all the colors in the color map. Returned to user. Passed by reference always.
color_spaceThe color space that the values are in. Returned to user. Passed by reference always.

◆ GetPieEdgeColor()

void HPieChart::GetPieEdgeColor ( char *  color)

Retrieves the color used for pie slice edges.

Parameters
colorA text string containing the color used for pie slice edges. Returned to user. Passed by reference always.

◆ GetPieEdgeVisibility()

bool HPieChart::GetPieEdgeVisibility ( )

Retrieves the flag that determines if pie edges are drawn.

Returns
True if the edge visibility and false if otherwise.

◆ GetPieRadius()

double HPieChart::GetPieRadius ( )

Gets the radius of the pie chart. Default value: 1.0.

Returns
The radius.

◆ GetPieSliceLabelContents()

void HPieChart::GetPieSliceLabelContents ( int  slice_id,
char *  str 
)

Retrieves the contents of a pie slice label.

Parameters
slice_idThe pie slice.
strA text string containing the pie slice label.

◆ GetPieSliceLabelTextFont()

void HPieChart::GetPieSliceLabelTextFont ( int  slice_id,
char *  font 
)

Retrieves the text font used to render a pie slice label.

Parameters
slice_idThe pie slice.
fontA text string containing the text font. Returned to user. Passed by reference always.

◆ GetPieSliceUnicodeLabelContents()

void HPieChart::GetPieSliceUnicodeLabelContents ( int  slice_id,
unsigned short *  str 
)

Gets the pie slice label contents in unicode.

Parameters
slice_idThe pie slice.
strA unicode string containing the pie slice label.

◆ RemovePieSlice()

void HPieChart::RemovePieSlice ( int  slice_id)

Removes (eats) a slice of the pie.

Parameters
slice_idThe slice to be removed.

◆ RemovePieSliceLabel()

void HPieChart::RemovePieSliceLabel ( int  slice_id)

Removes the label from a pie slice.

Parameters
slice_idThe pie slice.

◆ SetPieColorMap()

void HPieChart::SetPieColorMap ( const char *  map)

Sets the color map to be used for the pie chart. Pie slices are colored in the order they are added.

Parameters
mapA text string containing all the colors in the pie chart color map. Passed by reference always.

◆ SetPieColorMapByValue()

void HPieChart::SetPieColorMapByValue ( int  count,
const HPoint  values[],
const char *  color_space = 0 
)

Sets the color map by value to be used for the pie chart. Pie slices are colored in the order they are added.

Parameters
countThe number of colors in the values array.
valuesAn array of HPoints containing all the colors in the color map. Passed by reference always.
color_spaceThe color space that the values are in. Default value: "RGB"

◆ SetPieEdgeColor()

void HPieChart::SetPieEdgeColor ( const char *  color)

Sets the color used for pie slice edges.

Parameters
colorA text string containing the color used for pie slice edges. Passed by reference always.

◆ SetPieEdgeVisibility()

void HPieChart::SetPieEdgeVisibility ( bool  vis)

Sets the option to draw borders on pie slices.

Parameters
visIf true, the edge are drawn.

◆ SetPieRadius()

void HPieChart::SetPieRadius ( double  radius)

Sets a new radius for the pie chart.

Parameters
radiusThe new radius.

◆ SetPieSliceLabelTextFont()

void HPieChart::SetPieSliceLabelTextFont ( int  slice_id,
const char *  font 
)

Sets the text font used to render a pie slice label.

Parameters
slice_idThe pie slice.
fontA text string containing the text font. Passed by reference always.

◆ SetPlotOrigin()

void HPieChart::SetPlotOrigin ( HPoint  origin)

Sets the location of the plot origin.

Parameters
originAn HPoint value representing the new location of the title of the plot.

◆ SetPlotTitle()

void HPieChart::SetPlotTitle ( const char *  title)
virtual

Sets the title of the plot.

Parameters
titleThe title of the plot. Passed by reference always.

Implements HBaseGraph.

◆ SetPlotUnicodeTitle()

void HPieChart::SetPlotUnicodeTitle ( unsigned short *  title)
virtual

This method adds a unicode plot title or replaces the existing one.

Parameters
titleThe title of the plot.

Implements HBaseGraph.

◆ Update()

virtual void HPieChart::Update ( )
virtual

Force the segment tree to reflect any queued changes in the graph.

Reimplemented from HBaseGraph.


The documentation for this class was generated from the following file: