pygooglechart Module¶
pygooglechart - A complete Python wrapper for the Google Chart API
http://pygooglechart.slowchop.com/
Copyright 2007-2013 Gerald Kaszuba
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
-
class
pygooglechart.
Axis
(axis_index, axis_type, **kw)[source]¶ Bases:
object
-
BOTTOM
= 'x'¶
-
LEFT
= 'y'¶
-
RIGHT
= 'r'¶
-
TOP
= 't'¶
-
TYPES
= ('x', 't', 'y', 'r')¶
-
-
class
pygooglechart.
BarChart
(*args, **kwargs)[source]¶ Bases:
pygooglechart.Chart
-
class
pygooglechart.
Chart
(width, height, title=None, legend=None, colours=None, auto_scale=True, x_range=None, y_range=None, colours_within_series=None)[source]¶ Bases:
object
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.
-
ALPHA
= 'a'¶
-
BACKGROUND
= 'bg'¶
-
BASE_URL
= 'http://www.google.com/chart'¶
-
CHART
= 'c'¶
-
LINEAR_GRADIENT
= 'lg'¶
-
LINEAR_STRIPES
= 'ls'¶
-
SOLID
= 's'¶
-
VALID_SOLID_FILL_TYPES
= ('bg', 'c', 'a')¶
-
data_class_detection
(data)[source]¶ Determines the appropriate data encoding type to give satisfactory resolution (http://code.google.com/apis/chart/#chart_data).
-
scaled_data
(data_class, x_range=None, y_range=None)[source]¶ 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.
-
set_legend_position
(legend_position)[source]¶ Sets legend position. Default is ‘r’.
b - At the bottom of the chart, legend entries in a horizontal row. bv - At the bottom of the chart, legend entries in a vertical column. t - At the top of the chart, legend entries in a horizontal row. tv - At the top of the chart, legend entries in a vertical column. r - To the right of the chart, legend entries in a vertical column. l - To the left of the chart, legend entries in a vertical column.
-
-
class
pygooglechart.
ExtendedData
(data)[source]¶ Bases:
pygooglechart.Data
-
enc_map
= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.'¶
-
max_value
= 4095¶
-
-
class
pygooglechart.
GoogleOMeterChart
(*args, **kwargs)[source]¶ Bases:
pygooglechart.PieChart
Inheriting from PieChart because of similar labeling
-
class
pygooglechart.
GroupedBarChart
(*args, **kwargs)[source]¶ Bases:
pygooglechart.BarChart
-
class
pygooglechart.
LabelAxis
(axis_index, axis_type, values, **kwargs)[source]¶ Bases:
pygooglechart.Axis
-
class
pygooglechart.
LineChart
(*args, **kwargs)[source]¶ Bases:
pygooglechart.Chart
-
class
pygooglechart.
MapChart
(*args, **kwargs)[source]¶ Bases:
pygooglechart.Chart
-
add_data_dict
(datadict)[source]¶ Sets the data and country codes via a dictionary.
i.e. {‘DE’: 50, ‘GB’: 30, ‘AT’: 70}
-
set_codes
(codes)[source]¶ Set the country code map for the data. Codes given in a list.
- i.e. DE - Germany
- AT - Austria US - United States
-
-
class
pygooglechart.
PieChart
(*args, **kwargs)[source]¶ Bases:
pygooglechart.Chart
-
class
pygooglechart.
PieChart2D
(*args, **kwargs)[source]¶ Bases:
pygooglechart.PieChart
-
class
pygooglechart.
PieChart3D
(*args, **kwargs)[source]¶ Bases:
pygooglechart.PieChart
-
exception
pygooglechart.
PyGoogleChartException
[source]¶ Bases:
exceptions.Exception
-
class
pygooglechart.
QRChart
(*args, **kwargs)[source]¶ Bases:
pygooglechart.Chart
-
class
pygooglechart.
RadarChart
(width, height, title=None, legend=None, colours=None, auto_scale=True, x_range=None, y_range=None, colours_within_series=None)[source]¶ Bases:
pygooglechart.Chart
-
class
pygooglechart.
RangeAxis
(axis_index, axis_type, low, high, **kwargs)[source]¶ Bases:
pygooglechart.Axis
-
class
pygooglechart.
ScatterChart
(width, height, title=None, legend=None, colours=None, auto_scale=True, x_range=None, y_range=None, colours_within_series=None)[source]¶ Bases:
pygooglechart.Chart
-
class
pygooglechart.
SimpleData
(data)[source]¶ Bases:
pygooglechart.Data
-
enc_map
= 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'¶
-
max_value
= 61¶
-
-
class
pygooglechart.
SimpleLineChart
(*args, **kwargs)[source]¶ Bases:
pygooglechart.LineChart
-
class
pygooglechart.
SplineRadarChart
(width, height, title=None, legend=None, colours=None, auto_scale=True, x_range=None, y_range=None, colours_within_series=None)[source]¶ Bases:
pygooglechart.RadarChart
-
class
pygooglechart.
StackedHorizontalBarChart
(*args, **kwargs)[source]¶ Bases:
pygooglechart.BarChart
-
class
pygooglechart.
StackedVerticalBarChart
(*args, **kwargs)[source]¶ Bases:
pygooglechart.BarChart
-
class
pygooglechart.
TextData
(data)[source]¶ Bases:
pygooglechart.Data
-
max_value
= 100¶
-
-
class
pygooglechart.
VennChart
(width, height, title=None, legend=None, colours=None, auto_scale=True, x_range=None, y_range=None, colours_within_series=None)[source]¶ Bases:
pygooglechart.Chart