import barchart
class DataList(UserList) def __init__(self, list = None) string __module__ = 'barchart' def __str__(self) def add_column(self, name, pairs) def cache_labels(self) def decreasing(self, a, b) def increasing(self, a, b) def index(self, label) def load_tuple(self, t) def load_tuples(self, tt) def max(self, key='value') def mean(self, key='value') def min(self, key='value') tuple segment_names = ('value',) def sort(self, key='label', direction='increasing') def sum(self, key='value') def sum_totals(self) # Methods inherited by DataList from UserList def __add__(self, list) def __cmp__(self, list) def __delitem__(self, i) def __delslice__(self, i, j) def __getitem__(self, i) def __getslice__(self, i, j) def __len__(self) def __mul__(self, n) def __mul__(self, n) def __radd__(self, list) def __repr__(self) def __setitem__(self, i, item) def __setslice__(self, i, j, list) def append(self, item) def count(self, item) def insert(self, i, item) def pop(self, i=-1) def remove(self, item) def reverse(self)
Used by BarChart classes. Takes a list of sequences and loads them into a list of dictionaries using the first item from the sequence as a label key. The column names are from the segment_names attribute and must be set prior to loading multidimensional data.
Supports some simple data processing methods.
Return tabular string representation of internal data.
Take list of (label,value) pairs and add the data as a new column named name.
Create cache of indexes corresponding to the labels to speed calles to index method.
return dictionary corresponding to label string.
Load individual record of data into new dictionary.
Use first item in given sequence as label key and assigns remaining items with keys from segment_names in order.
Load each item from the given sequence of sequences.
return maximum value in column key
return mean (average) of values in column key
return minimum value in column key
Sort list according to key in direction.
Example: DLobject.sort(height
, 'decreasing')
return sum of values in column key
add new key total
to each dictionary
Copyright © Robin Friedrich
All Rights Reserved
Comments to author: dev@null
Generated: Tue Apr 20, 1999