GDChart is built on gd, Tom Boutell's library for creating PNG and JPEG images. In the past, gd was capable of creating GIFs. Due to the infamous Unisys patent encumbering the GIF format, recent versions of gd produce images in PNG and JPEG format -- GIFs are not supported.
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_PNG GDC_JPEG chart styles -- GDC_AREA GDC_3DAREA GDC_BAR GDC_3DBAR GDC_LINE GDC_3DLINE GDC_COMBO_LINE_AREA GDC_3DCOMBO_LINE_AREA GDC_COMBO_LINE_BAR GDC_3DCOMBO_LINE_BAR 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 percent placement options (pie charts) -- GDCPIE_PCT_NONE GDCPIE_PCT_ABOVE GDCPIE_PCT_BELOW GDCPIE_PCT_RIGHT GDCPIE_PCT_LEFT Functions: chart() -- create a chart option() -- set chart options
chart()
chart(s, (w, h), f, l, data...) s -- chart style (w,h) -- dimensions of GIF image (width, height) f -- file object or name of file where GIF 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...]) 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(keyword=value [,keyword=value...]) 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 xaxis=b annotation_font=e label_font=e xaxis_font=e bar_width=n label_line=b xlabel_color=c bg_color=c line_color=c xlabel_spacing=n bg_image=* other_threshold=n xtitle=s bg_transparent=b percent_labels=e xtitle_color=c border=b pie_color=(c) xtitle_font=e edge_color=c plot_color=c yaxis=b explode=(i) requested_ymax=n yaxis2=b ext_color=(c) requested_ymin=n yaxis_font=e ext_vol_color=(c) requested_yinterval=n ylabel_color=c format=e|(e,n) scatter=* ylabel_density=n generate_gif=b set_color=(c) ylabel_fmt=s grid=b stack_type=e ylabel2_color=c grid_color=c thumblabel=s ylabel2_fmt=s hard_graphheight=n thumbnail=b ytitle=s hard_graphwidth=n thumbval=n ytitle_color=c hard_size=b threed_angle=n ytitle_font=e hard_xorig=n threed_depth=n ytitle2=s hard_yorig=n title=s ytitle2_color=c hlc_cap_width=n title_color=c zeroshelf=b hlc_style=e title_font=e hold_img=b vol_color=c '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.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.