Package spade :: Module pygooglechart :: Class Chart
[hide private]
[frames] | no frames]

Class Chart

source code


Abstract class for all chart types.

width are height specify the dimensions of the image. title sets the title of the chart. legend requires a list that corresponds to datasets.

Instance Methods [hide private]
 
__init__(self, width, height, title=None, legend=None, colours=None, auto_scale=True, x_range=None, y_range=None, colours_within_series=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
get_url(self, data_class=None) source code
 
get_url_bits(self, data_class=None) source code
 
download(self, file_name) source code
 
set_title(self, title) source code
 
set_legend(self, legend)
legend needs to be a list, tuple or None
source code
 
set_legend_position(self, legend_position) source code
 
set_colours(self, colours) source code
 
set_colours_within_series(self, colours) source code
 
fill_solid(self, area, colour) source code
 
_check_fill_linear(self, angle, *args) source code
 
fill_linear_gradient(self, area, angle, *args) source code
 
fill_linear_stripes(self, area, angle, *args) source code
 
fill_to_url(self) source code
 
data_class_detection(self, data)
Determines the appropriate data encoding type to give satisfactory resolution (http://code.google.com/apis/chart/#chart_data).
source code
 
_filter_none(self, data) source code
 
data_x_range(self)
Return a 2-tuple giving the minimum and maximum x-axis data range.
source code
 
data_y_range(self)
Return a 2-tuple giving the minimum and maximum y-axis data range.
source code
 
scaled_data(self, data_class, x_range=None, y_range=None)
Scale `self.data` as appropriate for the given data encoding (data_class) and return it.
source code
 
add_data(self, data) source code
 
data_to_url(self, data_class=None) source code
 
annotated_data(self) source code
 
set_axis_labels(self, axis_type, values) source code
 
set_axis_range(self, axis_type, low, high) source code
 
set_axis_positions(self, axis_index, positions) source code
 
set_axis_style(self, axis_index, colour, font_size=None, alignment=None) source code
 
axis_to_url(self) source code
 
markers_to_url(self) source code
 
add_marker(self, index, point, marker_type, colour, size, priority=0) source code
 
add_horizontal_range(self, colour, start, stop) source code
 
add_data_line(self, colour, data_set, size, priority=0) source code
 
add_marker_text(self, string, colour, data_set, data_point, size, priority=0) source code
 
add_vertical_range(self, colour, start, stop) source code
 
add_fill_range(self, colour, index_start, index_end) source code
 
add_fill_simple(self, colour) source code
 
set_line_style(self, index, thickness=1, line_segment=None, blank_segment=None) source code
 
set_grid(self, x_step, y_step, line_segment=1, blank_segment=0) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  BASE_URL = 'http://chart.apis.google.com/chart?'
  BACKGROUND = 'bg'
  CHART = 'c'
  ALPHA = 'a'
  VALID_SOLID_FILL_TYPES = ('bg', 'c', 'a')
  SOLID = 's'
  LINEAR_GRADIENT = 'lg'
  LINEAR_STRIPES = 'ls'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, width, height, title=None, legend=None, colours=None, auto_scale=True, x_range=None, y_range=None, colours_within_series=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

scaled_data(self, data_class, x_range=None, y_range=None)

source code 

Scale `self.data` as appropriate for the given data encoding (data_class) and return it.

An optional `y_range` -- a 2-tuple (lower, upper) -- can be given to specify the y-axis bounds. If not given, the range is inferred from the data: (0, <max-value>) presuming no negative values, or (<min-value>, <max-value>) if there are negative values. `self.scaled_y_range` is set to the actual lower and upper scaling range.

Ditto for `x_range`. Note that some chart types don't have x-axis data.