Node:pie_plot, Next:, Previous:range_plot, Up:Top



Pie Plots

XXX %%pie_plot.T

arc_offsets list Attribute
Default: None. You can draw each pie "slice" offset from the center of the circle. This attribute specifies the amount of offset (in points) from the center. The value of None will draw the slice archored at the center.

arrow_style <class 'pychart.arrow.T'> Attribute
Default: None. The style of arrow that connects a label to the corresponding "pie".

center (x,y) Attribute
Default: None.

data any Attribute
Default: None. Specifies the data points. See chart_data.

data_col int Attribute
Default: 1. The column, within "data", from which the data values are retrieved.

fill_styles list Attribute
Default: ['fill_style.black', 'fill_style.gray70', 'fill_style.diag', 'fill_style.gray30', 'fill_style.rdiag', 'fill_style.gray10', 'fill_style.diag2', 'fill_style.white', 'fill_style.rdiag2', 'fill_style.vert', 'fill_style.diag3', 'fill_style.gray50', 'fill_style.horiz', 'fill_style.gray90', 'fill_style.rdiag3', 'fill_style.wave', 'fill_style.vwave', 'fill_style.stitch', 'fill_style.lines']. The fill style of each item. The length of the list should be equal to the length of the data.

label_col int Attribute
Default: 0. The column, within "data", from which the labels of items are retrieved.

label_fill_style <class 'pychart.fill_style.T'> Attribute
Default: fill_style.default.

label_line_style <class 'pychart.line_style.T'> Attribute
Default: None.

label_offset number Attribute
Default: None.

line_style <class 'pychart.line_style.T'> Attribute
Default: line_style.black.

radius number Attribute
Default: None.

shadow (xoff,yoff,fill) Attribute
Default: None. The value is either None or a tuple. When non-None, a drop-shadow is drawn beneath the object. X-off, and y-off specifies the offset of the shadow relative to the object, and fill specifies the style of the shadow (see fill_style).

start_angle number Attribute
Default: 90. The angle at which the first item is drawn.
pietest.png

Sample pie chart

Below is the source code that produces the above chart.

from pychart import *

import sys
data = [("foo", 10),("bar", 20), ("baz", 30), ("ao", 40)]

ar = area.T(size=(150,150), legend=legend.T(),
            x_grid_style = None, y_grid_style = None)

plot = pie_plot.T(data=data, arc_offsets=[0,10,0,10],
                  shadow = (2, -2, fill_style.gray50),
                  label_offset = 25,
                  arrow_style = arrow.a3)
ar.add_plot(plot)
ar.draw()