HPieChart

Detailed Description

class HPieChart : public HBaseGraph

Provides simple pie chart creation tools.

Public Functions

HPieChart(HC_KEY plot_seg)

HPieChart Constructor.

Parameters:plot_seg – The segment that all graph subsegments will be created beneath.
virtual ~HPieChart()

~HPieChart Destructor.

virtual void SetPlotTitle(char const *title)

Sets the title of the plot.

Parameters:title – The title of the plot. Passed by reference always.
virtual void SetPlotUnicodeTitle(unsigned short *title)

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

Parameters:title – The title of the plot.
int AddPieSlice(double size)

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

Parameters:size – The size of the pie slice.
Returns:The ID of the pie slice. Can be used to later modify or remove the slice.
void RemovePieSlice(int slice_id)

Removes (eats) a slice of the pie.

Parameters:slice_id – The slice to be removed.
void SetPieColorMap(char const *map)

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

Parameters:map – A text string containing all the colors in the pie chart color map. Passed by reference always.
void 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:map – A text string containing all the colors in the pie chart color map. Returned to user. Passed by reference always.
void SetPieColorMapByValue(int count, HPoint const values[], char const *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:
  • count – The number of colors in the values array.
  • values – An array of HPoints containing all the colors in the color map. Passed by reference always.
  • color_space – The color space that the values are in. Default value: “RGB”
void 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:
  • count – The number of colors in the values array. Returned to user. Passed by reference always.
  • values – An array of HPoints containing all the colors in the color map. Returned to user. Passed by reference always.
  • color_space – The color space that the values are in. Returned to user. Passed by reference always.
void AddPieSliceLabel(int slice_id, char const *str)

Labels a pie slice.

Parameters:
  • slice_id – The pie slice.
  • str – A text string containing the label of the pie slice. Passed by reference always.
void AddPieSliceUnicodeLabel(int slice_id, unsigned short const *str)

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

Parameters:
  • slice_id – The pie slice.
  • str – A unicode string containing the label of the pie slice. Passed by reference always.
void RemovePieSliceLabel(int slice_id)

Removes the label from a pie slice.

Parameters:slice_id – The pie slice.
void GetPieSliceLabelContents(int slice_id, char *str)

Retrieves the contents of a pie slice label.

Parameters:
  • slice_id – The pie slice.
  • str – A text string containing the pie slice label.
void GetPieSliceUnicodeLabelContents(int slice_id, unsigned short *str)

Gets the pie slice label contents in unicode.

Parameters:
  • slice_id – The pie slice.
  • str – A unicode string containing the pie slice label.
void SetPieSliceLabelTextFont(int slice_id, char const *font)

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

Parameters:
  • slice_id – The pie slice.
  • font – A text string containing the text font. Passed by reference always.
void GetPieSliceLabelTextFont(int slice_id, char *font)

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

Parameters:
  • slice_id – The pie slice.
  • font – A text string containing the text font. Returned to user. Passed by reference always.
bool GetPieEdgeVisibility()

Retrieves the flag that determines if pie edges are drawn.

Returns:True if the edge visibility and false if otherwise.
void SetPieEdgeVisibility(bool vis)

Sets the option to draw borders on pie slices.

Parameters:vis – If true, the edge are drawn.
void GetPieEdgeColor(char *color)

Retrieves the color used for pie slice edges.

Parameters:color – A text string containing the color used for pie slice edges. Returned to user. Passed by reference always.
void SetPieEdgeColor(char const *color)

Sets the color used for pie slice edges.

Parameters:color – A text string containing the color used for pie slice edges. Passed by reference always.
double GetPieRadius()

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

Returns:The radius.
void SetPieRadius(double radius)

Sets a new radius for the pie chart.

Parameters:radius – The new radius.
void SetPlotOrigin(HPoint origin)

Sets the location of the plot origin.

Parameters:origin – An HPoint value representing the new location of the title of the plot.
virtual void Update()

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