6
ROOT = os.path.dirname(os.path.abspath(__file__))
7
sys.path.insert(0, os.path.join(ROOT, '..'))
9
from pygooglechart import PieChart2D
10
from pygooglechart import PieChart3D
16
chart = PieChart3D(settings.width, settings.height)
17
chart.add_data([ord(a) for a in 'hW'])
18
chart.set_pie_labels(['Hello', 'World'])
19
chart.download('pie-hello-world.png')
21
def house_explosions():
23
Data from http://indexed.blogspot.com/2007/12/meltdown-indeed.html
25
chart = PieChart2D(int(settings.width * 1.7), settings.height)
26
chart.add_data([10, 10, 30, 200])
27
chart.set_pie_labels([
31
'Attempts to escape morgage',
33
chart.download('pie-house-explosions.png')
39
if __name__ == '__main__':
3
Copyright Gerald Kaszuba 2008
5
This program is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
15
You should have received a copy of the GNU General Public License
16
along with this program. If not, see <http://www.gnu.org/licenses/>.
22
ROOT = os.path.dirname(os.path.abspath(__file__))
23
sys.path.insert(0, os.path.join(ROOT, '..'))
25
from pygooglechart import PieChart2D
26
from pygooglechart import PieChart3D
33
# Create a chart object of 200x100 pixels
34
chart = PieChart3D(250, 100)
37
chart.add_data([20, 10])
39
# Assign the labels to the pie data
40
chart.set_pie_labels(['Hello', 'World'])
43
chart.download('pie-hello-world.png')
45
def house_explosions():
47
Data from http://indexed.blogspot.com/2007/12/meltdown-indeed.html
49
chart = PieChart2D(int(settings.width * 1.7), settings.height)
50
chart.add_data([10, 10, 30, 200])
51
chart.set_pie_labels([
55
'Attempts to escape morgage',
57
chart.download('pie-house-explosions.png')
63
if __name__ == '__main__':