|
Methods defined here:
- __init__(self)
- __init__()
- __str__(self)
- The class instance string representation is the complete
XML output, from all currently set attributes.
- addColumnLabel(self, *labels)
- ACTION:
Add one or more string labels for the columns in the graph. There
needs to be enough column labels to correspond to the length of the data
in the rows. Otherwise, they will be labeled "Undef".
INPUT: str label, [str label], [...]
OUTPUT: NONE
- addDrawElement(self, element, **kwargs)
- ACTION:
Creates a new draw element in the graph. Draw elements are
a few defined graphic objects that can be inserted into either
the background or foreground of the graph. The draw elements
each have their own respective attributes for controlling how
and where they are displayed.
For element type 'text', specify the text with the key 'value'.
So, value='some text'
Reference the API doc for details on each elements types
attributes.
INPUT:
str element - (circle, image, line, rect, text, button)
Key=Value - attributes for the draw element type
OUTPUT: NONE
- addFilter(self, filterType, id, **kwargs)
- ACTION:
Adds a new filter to the list of defined filters.
Valid filter types are shadow, bevel, glow, and blur.
You can defined multiple types of each, and give them
unique ids, to be referenced in other methods.
Each filter type has its own set of key/value attributes,
so refer to the API doc for specifics.
INPUT:
str filterType - 'shadow', 'bevel', 'glow', or 'blur'
str id - a unique string id to be known as ('shadow1')
key = value - attributes for the specific filter type
OUTPUT: NONE
- addLink(self, **kwargs)
- ACTION:
holds any number of areas, each defining a rectangle and a
URL to go to when the user clicks inside the rectangle.
This can also be used to assign functions to mouse clicks,
including chart updates, printing, etc
INPUT:
int x - x position of upper left corner of rectangle
int y - y position of upper left corner of rectange
int width - width of rectangle
int height - height of rectable
str url - relative or absolute URL to go to when clicked
int priority - determined how to handle links that overlap
if 0, priority is determined by order of links
if 1, link will be activated during overlap
str target - where to open the URL when clicked
Window options: (_self, _blank, _parent, _top)
Other options: (update, print, toggle_fullscreen, scroll)
* If any other <string> value is specified, the URL will
be opened in a window named <string>. If it does not
exist, it will be created first.
str tooltip - tooltip text to display over link
* Valid if target = 'update'
int timeout - time to wait for update before failing; seconds
int retry - number of times to retry when failing
bool spinning_wheel - if True, show a spinning wheel while updating
OUTPUT: NONE
- addRow(self, label, *data)
- ACTION:
Sets a row of data in the xml chart_data section.
label is a string name of the data set, followed by any amount
of numeric data items.
Each data object can either be a float/int value, OR, it can be
a dictionary. Providing a dictionary lets you add special effects
and options to each value to be used in the graph display.
The dictionary must AT LEAST have a 'value' key, which is the data
value. Other options are as follows:
label - string label for the individual data
note - string note to be attached to the data in the chart
tooltip - string tooltip message that will appear during mouseOver
shadow - string id of a shadow filter to apply
bevel - string id of a bevel filter to apply
glow - string id of a glow filter to apply
blur - string id of a blur filter to apply
alpha - transparency value from 0-100 (transparent-opaque)
line_color - border line color, string hex value ('000000')
line_alpha - transparency value of border from 0-100 (transparent-opaque)
line_thickness - int pixel thickness of border (default 1 pixel)
For options that take a filter id (shadow, bevel, glow, blur), you must
have defined this filter name using the addFilter_ methods.
Keep in mind that rows must all contain the same number of data
elements to maintain consistency with their column labels.
INPUT:
str label - name of the data set
float/int/dict *data - data1, [data2], [...]
OUTPUT: NONE
- clearDrawElements(self)
- ACTION: Clear the current draw elements
INPUT: NONE
OUTPUT: NONE
- clearFilters(self)
- ACTION: Clear the current filters
INPUT: NONE
OUTPUT: NONE
- clearLinks(self)
- ACTION: Clear the current links
INPUT: NONE
OUTPUT: NONE
- clearRows(self)
- ACTION: Clear the current rows data
INPUT: NONE
OUTPUT: NONE
- getXML(self)
- ACTION:
Return the final formatted XML of all attributes, as a string
Same as treating the class instance as a string.
INPUT: NONE
OUTPUT: NONE
- setAxisCategory(self, **kwargs)
- ACTION: sets the label attributes for the category-axis
INPUT:
Valid Key/Value pairs:
Review API docs
OUTPUT : NONE
- setAxisCategoryLabel(self, *labels)
- ACTION:
Overrides axis labels
INPUT:
string label1, [label2], [...]
OUTPUT : NONE
- setAxisTicks(self, **kwargs)
- ACTION: sets the tick marks on the chart axes
INPUT:
Valid Key/Value pairs:
Review API docs
OUTPUT : NONE
- setAxisValue(self, **kwargs)
- ACTION: sets the label attributes for the value-axis
INPUT:
Valid Key/Value pairs:
Review API docs
OUTPUT : NONE
- setAxisValueLabel(self, *labels)
- ACTION:
Overrides axis labels
INPUT:
string label1, [label2], [...]
OUTPUT : NONE
- setChartBorder(self, top=0, bottom=0, left=0, right=0, color='000000')
- ACTION: Set the border thickness and color for the chart
INPUT:
int top - thickness of top
int bottom - thickness of bottom
int left - thickness of left
int right - thickness of right
str color - hex color ('000000', or 'FFFFFF' format)
OUTPUT : NONE
- setChartGrid(self, direction, thickness=1, color='000000', alpha=20, type='solid')
- ACTION: sets the chart's vertical or horizontal grid attributes.
INPUT:
str direction - 'vertical' or 'horizontal' grid lines
int thickness - thickness of grid (default 1)
str color - hex color (default '000000')
alpha - transparency from 0-100 (default 20)
type - line type ('solid', 'dotted', 'dashed')
OUTPUT : NONE
- setChartGuide(self, **kwargs)
- ACTION:
sets one or two guide lines to connect the cursor position
with the axes and simplify reading their values. The guides
are the two red lines that move with the cursor when the mouse
is over this chart
INPUT:
Valid Key/Value args:
bool horizontal, bool vertical, int thickness, str color ('000000'),
int alpha (0-100), str type ('solid', 'dotted', 'dashed'),
bool snap_h, bool snap_v, bool connect
int radius, str fill_color ('000000'), int fill_alpha (0-100),
str line_color ('000000'), int line_alpha (0-100), int line_thickness
int text_alpha (0-100), int text_v_alpha (0-100), str prefix_h,
str suffix_h, str prefix_v, str suffix_v, int decimals,
str decimal_chars, str separator, str font, bool bold, int size,
str text_color ('000000'), str background_color ('000000')
OUTPUT : NONE
- setChartLabel(self, **kwargs)
- ACTION: sets the attributes of the labels that appear over the graphs
INPUT:
Valid Key/Value args:
str prefix, str suffix, int decimals, str decimal_char,
str separator, str position, bool hide_zero,
bool as_percentage, str font, bool bold, int size,
str color ('000000'), str background_color ('000000'),
int alpha (0-100)
Filter IDs:
str shadow, str bevel, str glow, str blur
OUTPUT : NONE
- setChartNote(self, **kwargs)
- ACTION: defines the look of comments that can be attached to data or category points
INPUT:
Valid Key/Value args:
str type, int x, int y, int offset_x, int offset_y,
str font, bool bold, int size, str color ('000000'),
int alpha (0-100), str background_color ('000000'),
int background_alpha (0-100)
Filter IDs:
str shadow, str bevel, str glow, str blur
OUTPUT : NONE
- setChartPref(self, **kwargs)
- ACTION:
sets the preferences for some charts
Groups of key/value attributes are only valid for certain charts
INPUT:
general:
bool zero_line
line chart:
int line_thickness, str point_shape, int point_size,
bool fill_shape, bool connect, str tip
candlestick chart:
str type, int line_thickness, str bull_color, str bear_color
scatter chart:
int point_size, str point_shape, int trend_thickness,
int trend_alpha, int line_thickness
3d chart:
int rotation_x, int rotation_y, bool drag, int min_x,
int max_x, int min_y, int max_y
polar chart:
str type, str grid, int line_thickness, str point_shape,
int point_size, bool fill_shape
pie chart:
bool select
image chart:
bool stretch
donut chart:
bool empty_center, bool select
OUTPUT : NONE
- setChartRect(self, **kwargs)
- ACTION:
sets the chart's rectangle. This is the area in which the graphing
is drawn. Not including the legend or the axis labels
INPUT:
Valid Key/Value args:
int x, int y, int width, int height,
str positive_color, str negative_color,
int positive_alpha, int negative_alpha,
int corner_tl, int corner_tr,
int corner_br, int corner_bl,
bool hide
Filter IDs:
str shadow, str bevel, str glow, str blur
OUTPUT : NONE
- setChartTransition(self, type='none', delay=0, duration=1, order='all')
- ACTION:
sets the chart's transition attributes
INPUT:
str type - (dissolve, drop, spin, scale, zoom, blink, slide_right,
slide_left, slide_up, slide_down, and none)
float delay - delay in seconds (default 0)
float duration - duration in seconds (default 1)
str order - order in which to transition the charts parts
(series, category, all)
OUTPUT : NONE
- setChartType(self, *types)
- ACTION:
sets the type of chart to draw
You may specify one or more chart types as args. Note that
the number of mixed chart types must correspond to the
number of rows that were added. Each row will be
represented with the matching chart type.
Only area, column, and line chart types are valid for
mixed charts
INPUT:
str type -
column (default)
stacked column
floating column
3d column
image column
stacked 3d column
parallel 3d column
pie
3d pie
image pie
donut
bar
stacked bar
floating bar
area
stacked area
3d area
stacked 3d area
candlestick
scatter
polar
bubble
vline
OUTPUT : NONE
- setContextMenu(self, about=True, printOpt=True, full_screen=True, quality=True, jpeg_url=None)
- ACTION:
sets the options for the right click context menu of the graph
INPUT:
bool about - show the About SWF Charts option
bool printOpt - option to print graph
bool full_screen - show graph in full screen mode
bool quality - Include quality options in context
str jpeg_url - url of a the php script that enables Export to JPEG
(must be server-side)
OUTPUT : NONE
- setLegend(self, **kwargs)
- ACTION:
sets the legend's attributes. The legend is the area that
identifies the colors assigned to the graphs
INPUT:
Valid Key/Value pairs:
Review API docs
OUTPUT : NONE
- setLicense(self, lic)
- ACTION:
set the license code for the chart, if you have one
INPUT:
str lic - license reg code
OUTPUT : NONE
- setLinkData(self, url, target='_self', timeout=30, retry=2, spinning_wheel=False)
- ACTION:
sets the overall link action for clicking on any chart element
INPUT:
str url - relative or absolute URL to process
str target - window to open or action to take
* Valid if target == 'update'
int timeout - time in seconds to wait for update to complete before fail
int retry - how many times to retry the update
bool spinning_wheel - show a spinning wheel while updating
OUTPUT : NONE
- setScroll(self, **kwargs)
- ACTION:
activates and sets the attributes of a slider that makes
the chart scrollable. Scrolling is supported by all chart
types except for 3d, pie, donut, polar, scatter, bubble,
and image charts.
INPUT:
Valid Key/Value pairs:
Review API docs
OUTPUT : NONE
- setSeries(self, bar_gap=0, set_gap=20, transfer=False)
- ACTION:
determines the look of the series graphs of some chart types
INPUT:
int bar_gap - 0 to 100
int set_gap - 0 to 100
bool transfer - default False
OUTPUT : NONE
- setSeriesColor(self, *colors)
- ACTION:
sets the colors to use for the chart series
Color is a 6 character hex value, ie. '000000'
Each color arg corresponds to the order of rows (series)
in the graph
INPUT:
str color1, [color2], [...]
OUTPUT : NONE
- setSeriesExplode(self, *vals)
- ACTION:
Applies to pie, line, and scatter charts ONLY.
A percentage value determining how far to sepearate
a 'slice' from its center. Each value in the args
corresponds to that 'slice' in the graph.
If you just set one value to 50, then only the first slice
is affected and set to 50% explode, and so on.
INPUT:
int val1, [val2], [...]
OUTPUT : NONE
- setTooltip(self, **kwargs)
- ACTION:
defines the look of the cursor label that appears
when the mouse moves over some chart elements
INPUT:
Valid Key/Value pairs:
Review API docs
OUTPUT : NONE
- setUpdate(self, url, delay=0, timeout=30, retry=2, mode='normal', span=10)
- ACTION:
updates the chart without reloading the web page. This makes
it possible to display charts with live data, change the chart's
look over time for emphasis, or create a slideshow from different charts.
INPUT:
str url - relative or absolute url to get XML source
int delay - interval between updates, in seconds
int timeout - time to wait for an update before timing out, in seconds
int retry - number of times to retry before erroring out, default 2
str mode - update mode applied to chart
(normal, reset, data, stream_category, stream_series)
int span - applies only if mode is stream_category or stream_series.
max number of rows or columns to maintain before deleting old
OUTPUT : NONE
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
- axis_category
- axis_category_label
- axis_ticks
- axis_value
- axis_value_label
- chart_border
- chart_data
- Returns the formatted <chart_data> xml section
- chart_grid_h
- chart_grid_v
- chart_guide
- chart_label
- chart_note
- chart_pref
- chart_rect
- chart_transition
- chart_type
- context_menu
- draw
- returns the formatted <draw> XML element
- filter
- returns the formatted <filter> XML element
- legend
- license
- link
- returns the formatted <link> XML element
- link_data
- scroll
- series
- series_color
- series_explode
- tooltip
- update
|