raiseTypeError,"Non-number passed to data: %s"%(data)
return(min(data),max(data))
defround_down(val,bound):
returnint(val/float(bound))*bound
defround_up(val,bound):
return(int((val-1)/float(bound))+1)*bound
#
# Attribute type checking stuff
#
defnew_list():
return[]
defunion_dict(dict1,dict2):
dict=dict1.copy()
dict.update(dict2)
returndict
defTextVAlignType(val):
ifvalin('T','B','M',None):
returnNone
return"Text vertical alignment must be one of T(op), B(ottom), or M(iddle).\n"
defTextAlignType(val):
ifvalin('C','R','L',None):
returnNone
return"Text horizontal alignment must be one of C(enter), R(ight), or L(eft)."
defapply_format(format,val,defaultidx):
ifformat==None:
returnNone
eliftype(format)==StringType:
returnformat%val[defaultidx]
else:
returnapply(format,val)
data_desc="Specifies the data points. <<chart_data>>"
label_desc="The label to be displayed in the legend. <<legend>>, <<font>>"
xcol_desc="""The column, within attribute "data", from which the X values of sample points are extracted. <<chart_data>>"""
ycol_desc="""The column, within attribute "data", from which the Y values of sample points are extracted. <<chart_data>>"""
tick_mark_desc="Tick marks to be displayed at each sample point. <<tick_mark>>"
line_desc="The style of the line. "
definterval_desc(w):
return"When the value is a number, it specifies the interval at which %s are drawn. Otherwise, the value must be a function that takes no argument and returns the list of numbers. The return value specifies the X or Y points at which %s are drawn."%(w,w)
shadow_desc="""The value is either None or a tuple. When non-None,