Node:pie_plot,
Next:legend,
Previous:range_plot,
Up:Top
Pie Plots
arc_offsets type: list
|
Attribute |
Default: None. You can draw each pie "slice" shifted off-center.
This attribute, if non-None,
must be a number sequence whose length is equal to
the number of pie slices. The Nth value in arc_offsets
specify the amount of offset
(from the center of the circle)
for the Nth slice.
The value of None will draw all the slices
anchored at the center.
|
arrow_style type: arrow.T
|
Attribute |
Default: None. The style of arrow that connects a label
to the corresponding "pie".
See arrow.
|
center type: (x,y)
|
Attribute |
Default: None. The location of the center of the pie.
|
Default: None. Specifies the data points. See chart_data.
|
data_col type: int
|
Attribute |
Default: 1. The column, within "data", from which the data values are retrieved.
|
fill_styles type: list
|
Attribute |
Default: ['fill_style.black', 'fill_style.gray70', 'fill_style.diag', 'fill_style.gray50', 'fill_style.vert', 'fill_style.rdiag', 'fill_style.white', 'fill_style.gray30', 'fill_style.gray10', 'fill_style.diag2', 'fill_style.rdiag2', 'fill_style.diag3', '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 type: int
|
Attribute |
Default: 0. The column, within "data", from which the labels of items are retrieved.
|
label_fill_style type: fill_style.T
|
Attribute |
Default: fill_style.default. The fill style of the frame surrounding each label.
See fill_style.
|
label_line_style type: line_style.T
|
Attribute |
Default: None. The style of the frame surrounding each label.
See line_style.
|
label_offset type: number
|
Attribute |
Default: None. The distance from the center of each label.
|
line_style type: line_style.T
|
Attribute |
Default: line_style.black. The style of the outer edge of each pie slice.
See line_style.
|
radius type: number
|
Attribute |
Default: None. The radius of the pie.
|
shadow type: (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 type: number
|
Attribute |
Default: 90. The angle at which the first item is drawn.
|
Sample pie chart
Below is the source code that produces the above chart.
../demos/pietest.py
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()