GooPie2d

GooPie2d — pie charts.

Synopsis

struct              GooPie2d;
struct              GooPie2dClass;
GooPie2d *          goo_pie2d_new                       (GooCanvasItem *Parent,
                                                         GooDataPoints *Dat,
                                                         GooType X,
                                                         GooType Y,
                                                         GooType Width_,
                                                         GooType Height,
                                                         ...);

Object Hierarchy

  GObject
   +----GooCanvasItemSimple
         +----GooCanvasGroup
               +----GooPie2d

Implemented Interfaces

GooPie2d implements GooCanvasItem.

Properties

  "channels"                 gchar                 : Read / Write
  "filler"                   gpointer              : Read / Write
  "format"                   gchar                 : Read / Write
  "gaps"                     gchar                 : Read / Write
  "segmented"                gchar                 : Read / Write

Description

GooPie2d is a subclass of GooCanvasGroup and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width". It also inherits the GooCanvasItem interface, so you can use the GooCanvasItem functions such as goo_canvas_item_raise() and goo_canvas_item_rotate().

To create a GooPie2d use goo_pie2d_new().

Setting a style property on a GooPie2d will affect all children in the GooPie2d group (unless the children override the property setting).

The GooPie2d group contains these childs:

  • a GooCanvasGroup for the pie segments (several GooCanvasPath),

  • a GooCanvasGroup for the labels (several GooCanvasText).

Details

struct GooPie2d

struct GooPie2d;

The GooPie2d struct contains private data only.


struct GooPie2dClass

struct GooPie2dClass;

The GooPie2dClass struct contains private data only.


goo_pie2d_new ()

GooPie2d *          goo_pie2d_new                       (GooCanvasItem *Parent,
                                                         GooDataPoints *Dat,
                                                         GooType X,
                                                         GooType Y,
                                                         GooType Width_,
                                                         GooType Height,
                                                         ...);

Create a new pie chart item from values in Dat. By default channel 0 (zero) is used. Specify an alternative channel by "channels". Each value gets a pie segment in a different goo_color() and width. Small segments are unvisible until they are separated from their neighbors by a "gaps". Negative values are scaled by -1.

Parent :

the parent item, or NULL. If a parent is specified, it will assume ownership of the item, and the item will automatically be freed when it is removed from the parent. Otherwise call g_object_unref() to free it.

Dat :

the data values to draw with

X :

the x coordinate of the left top corner of the area for the pie chart.

Y :

the y coordinate of the left top corner of the area for the pie chart

Width_ :

the width of the area for the pie chart

Height :

the height of the area for the pie chart

... :

optional pairs of property names and values, and a terminating NULL.

Returns :

a new pie item. [transfer full]

Since 0.0

Property Details

The "channels" property

  "channels"                 gchar                 : Read / Write

The channels in Dat to read the data from. By default the first channel (0 = zero) is used. This may contain

  • no value to draw a standard pie chart by the values of the default channel (= 0). Example "" or NULL.

  • one or more channel numbers for a standard pie chart. If more than one channel is set each column gets a ring of pie segments starting at the center. Only positive values are valid in Dat (negative values gets scaled by -1). Example: "7 9" to draw a pie chart of channel 7 in the center and a pie ring of channel 9 around it.

  • the start letter 'A' and two or more channel numbers to draw an avarage bar-type pie graph. Each row in Dat gets a group of bar-segments. Positive and negative values are valid in Dat. Scaling is done by the maximum differenz (smallest and largest value) and the bars of a group start at the avarage value of the group. Example: "a 1 2 3" to draw bar segments from channels 1, 2 and 3 from the avarage values of this channels.

  • the start letter 'B' and two or more channel numbers to draw a bar-type pie graph. Each value in Dat gets a bar-segment. Positive and negative values are valid in Dat. Scaling is done by the maximum differenz (smallest and largest value). All bars start at the center (mind the second value in "gaps"). Example: "b 1 2 3" to draw bar segments from channels 1, 2 and 3 from the center.

  • the start letter 'C' and two or more channel numbers to draw a bar-type pie graph with bar segments starting at the value of the first channel. Each row in Dat gets a group of bar-segment. Positive and negative values are valid in Dat. Scaling is done by the maximum differenz (smallest and largest value). Example: "c 1 2 3" to draw bar segments from channels 2 and 3 starting at the value of channel 1.

  • the start letter 'G' and one or more channel numbers to draw a Gantt type pie chart. The specified channels set the width of the pie segments. Their start angles are set by the previous channel values. Example: "g 1" draws pie segments of the width by channel 1 and the start angle by channel 0. The segments of additional channels will be drawn in a separate ring. Segments with a width of zero gets skipped. Both, the start angle and the width values should be in the range of [0, 0.9999999] where 0 is equal to 0 degrees and 1 is equal to 360 degrees (, negative values gets scaled by -1; values greater than 1 are reduced to their fractional part). In a Gantt type pie chart gaps are only between the rings but not between the segments in circular direction.

  • the start letter 'P' and two or more values to draw a chart of stacked pie segments. Each row in Dat gets a stack, scaled to 100 percent. Each stack has the same height (radius). The height of each segment is equal to the percentage rate based on the sum of the row. The segments of a channel are in same color. Only positive values are valid (negative values are scaled by -1). Example: "P 4 5 6" to stack the percentage values of channels 4, 5 and 6.

  • the start letter 'S' and two or more values to draw a chart of stacked bar-segments. Only positive values are valid (and negative values are scaled by -1). The segments start at the center. Each value creates a segment on top of the previous. Example: "S 4 7 2" to stack the values from channel 4, 7 and 2 (latest at the outside).

  • the start letter 'V', a real number and one or more channel numbers to draw a bar-type pie graph with bar segments starting at the specified value. Each value in Dat gets a bar-segment. Positive and negative values are valid in Dat. Scaling is done by the maximum differenz (smallest and largest value). Example: "v 1.7 1 2 3" to draw bar segments from channels 1, 2 and 3 starting at the value 1.7.

When a channel number is greater than the number of columns in Dat (or negative) no pie graph will be drawn.

Default value: NULL

Since 0.0


The "filler" property

  "filler"                   gpointer              : Read / Write

The filler object to set color/pattern/pixbuf for pie segments.


The "format" property

  "format"                   gchar                 : Read / Write

By default only the pie segments are drawn.

Default value: NULL

Since 0.0


The "gaps" property

  "gaps"                     gchar                 : Read / Write

The gaps between pie segments and optional free space in the center. By default the pie segments are placed side by side. A gap can be set to be drawn between the pie segments. This may contain

  • no value to draw the pie segments side by side. Example "" or NULL.

  • one value to set a gap factor. The size of the gaps is specified as a factor of the circumference of the pie graph (see "segmented"). If the pie graph has an area from 0 to 360 degrees, a factor of 0.01 will use 1 percent (= 3.6 degrees) for each gap. Segments smaller than the gaps gets unvisible. Example: "0.005"

  • two values to set the gap size and the free area in the center... 0 < center < 1.0

Default value: NULL

Since 0.0


The "segmented" property

  "segmented"                gchar                 : Read / Write

The area of the pie chart. The string can contain one or two values. By default the pie segments are started at the mathematical zero angle (3 o'clock) and are drawn over an angle of 360 degrees. An offset can be specified to rotate the pie segment start. The second value limits the range of the pie graph. Bith values are scaled in degrees. This may contain

  • no values for default (= "0 360"). Example NULL or "".

  • one value for the start angle. Example "45" to start the graph at 45 degrees (and use a full circle).

  • two values to set a start angle and the angular range. Example: "0 180" to set the start angle to 0 degrees and to use only the upper half of the cirle (180 degrees).

If the second value is less than 360 both radius of the pie chart grow to fill the given area. The center of the pie chart may be drawn outside the center of the specified graph area.

Default value: NULL

Since 0.0