This module provides an interface to the GDChart library by Bruce Verderaime (see http://www.fred.net/brv/chart/). Dynamic objects: error -- Module-level exception. Constants: image formats -- GDC_GIF GDC_JPEG GDC_PNG chart styles -- GDC_AREA GDC_3DAREA GDC_BAR GDC_3DBAR GDC_FLOATINGBAR GDC_3DFLOATINGBAR GDC_LINE GDC_3DLINE GDC_COMBO_LINE_AREA GDC_3DCOMBO_LINE_AREA GDC_COMBO_LINE_BAR GDC_3DCOMBO_LINE_BAR GDC_COMBO_LINE_LINE GDC_3DCOMBO_LINE_LINE GDC_HILOCLOSE GDC_3DHILOCLOSE GDC_COMBO_HLC_AREA GDC_3DCOMBO_HLC_AREA GDC_COMBO_HLC_BAR GDC_3DCOMBO_HLC_BAR GDC_2DPIE GDC_3DPIE fonts -- GDC_TINY GDC_SMALL GDC_MEDBOLD GDC_LARGE GDC_GIANT stack options -- GDC_STACK_BESIDE GDC_STACK_DEPTH GDC_STACK_LAYER GDC_STACK_SUM hi-lo-close styles (may be combined) -- GDC_HLC_CLOSE_CONNECTED GDC_HLC_CONNECTING GDC_HLC_DIAMOND GDC_HLC_I_CAP scatter point styles -- GDC_SCATTER_TRIANGLE_DOWN GDC_SCATTER_TRIANGLE_UP GDC_SCATTER_CIRCLE percent placement options (pie charts) -- GDCPIE_PCT_NONE GDCPIE_PCT_ABOVE GDCPIE_PCT_BELOW GDCPIE_PCT_RIGHT GDCPIE_PCT_LEFT border styles -- GDC_BORDER_NONE GDC_BORDER_ALL GDC_BORDER_X GDC_BORDER_Y GDC_BORDER_Y2 GDC_BORDER_TOP tick styles (for 'grid' and 'ticks' options) -- GDC_TICK_LABELS GDC_TICK_POINTS GDC_TICK_NONE other -- GDC_INTERP_VALUE => interpolate data value if 'interpolations' opt is true Functions: chart() -- create a chart option() -- get and set chart options
chart()
chart(s, (w, h), f, l, data...) s -- chart style (w,h) -- dimensions of image (width, height) f -- file object or name of file where image should be written l -- sequence of x-axis labels data -- one or more sequences of data values, depending on the chart style: simple: chart(s, (w,h), f, l, d [,d...]) float bar: chart(s, (w,h), f, l, (dl,dh) [,(dl,dh)...]) combo: chart(s, (w,h), f, l, d [,d...], da) hi-lo-close: chart(s, (w,h), f, l, (dh,dl,dc) [,(dh,dl,dc)...]) combo hlc: chart(s, (w,h), f, l, (dh,dl,dc) [,(dh,dl,dc)...], dv) pie: chart(s, (w,h), f, l, d [, p]) missing values: for pie charts, p is a sequence indicating which values in d are 'present' (0 or None => corresponding value in d is missing) for other charts, None in a dataset indicates a missing value
option()
option() -- return a dictionary of current option settings option(keyword=value [,keyword=value...]) -- change one or more options keywords and type codes -- b: boolean c: color (0xRRGGBB) e: enum (GDC_*) n: number s: string *: not implemented (x): sequence of type x annotation=* label_dist=n vol_color=c annotation_font=e label_font=e xaxis=b bar_width=n label_line=b xaxis_font=e bg_color=c line_color=c xlabel_color=c bg_image=* other_threshold=n xlabel_spacing=n bg_transparent=b percent_format=s xtitle=s border=e percent_labels=e xtitle_color=c edge_color=c pie_color=(c) xtitle_font=e explode=(i) plot_color=c yaxis=b ext_color=(c) requested_yinterval=n yaxis2=b ext_vol_color=(c) requested_ymax=n yaxis_font=e format=e|(e,n) requested_ymin=n ylabel_color=c generate_img=b scatter=* ylabel_density=n grid=e|n set_color=(c) ylabel_fmt=s grid_color=c stack_type=e ylabel2_color=c hard_graphheight=n threed_angle=n ylabel2_fmt=s hard_graphwidth=n threed_depth=n ytitle=s hard_size=b thumblabel=s ytitle_color=c hard_xorig=n thumbnail=b ytitle_font=e hard_yorig=n thumbval=n ytitle2=s hlc_cap_width=n ticks=e|n ytitle2_color=c hlc_style=e title=s zeroshelf=b hold_img=b title_color=c interpolations=b title_font=e 'format' specifies the image format (default is GDC_PNG). With GDC_JPEG, you can optionally specify the image quality (0-95, or -1 for default).
Version 0.41 (09 May 2000):
Version 0.4 (02 May 2000):
Version 0.3 (17 Feb 2000):
Version 0.2 (03 Feb 2000):
Version 0.1 (11 Aug 1999):
You can use the Python module as you see fit, but if you distribute a modified version, please identify it as such. The software comes with no warranty, etc.
Latest (version 0.5)