/+junk/pygooglechart-py3k

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/pygooglechart-py3k

« back to all changes in this revision

Viewing changes to examples/line.py

  • Committer: gak
  • Date: 2008-02-08 01:50:25 UTC
  • Revision ID: git-v1:8c340755d9a19844ac20af7046ddddc47f6171a2
Added automatic scaling patch from Trent Mick

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
import helper
15
15
 
16
16
def simple_random():
17
 
    chart = SimpleLineChart(settings.width, settings.height)
 
17
    chart = SimpleLineChart(settings.width, settings.height, y_range=(0, 100))
18
18
    chart.add_data(helper.random_data())
19
19
    chart.download('line-simple-random.png')
20
20
 
21
21
def xy_random():
22
 
    chart = XYLineChart(settings.width, settings.height)
 
22
    chart = XYLineChart(settings.width, settings.height, 
 
23
                        x_range=(0, 100), y_range=(0, 100))
23
24
    chart.add_data(helper.random_data())
24
25
    chart.add_data(helper.random_data())
25
26
    chart.download('line-xy-random.png')
26
27
 
27
28
def xy_rect():
28
 
    chart = XYLineChart(settings.width, settings.height)
 
29
    chart = XYLineChart(settings.width, settings.height,
 
30
                        x_range=(0, 100), y_range=(0, 100))
29
31
    chart.add_data([10, 90, 90, 10, 10])
30
32
    chart.add_data([10, 10, 90, 90, 10])
31
33
    chart.download('line-xy-rect.png')
32
34
 
33
35
def xy_circle():
34
 
    chart = XYLineChart(settings.width, settings.height)
 
36
    chart = XYLineChart(settings.width, settings.height,
 
37
                        x_range=(0, 100), y_range=(0, 100))
35
38
    steps = 40
36
39
    xradius = 25
37
40
    yradius = 45