Changeset 31

Show
Ignore:
Timestamp:
10/17/07 11:13:43 (5 years ago)
Author:
lgs
Message:

Move the data to another module for reuse

Location:
trunk/examples
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/examples/piechart.py

    r30 r31  
    2222import pycha.pie 
    2323 
     24from lines import lines 
     25 
    2426def pieChart(output): 
    2527    surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, 400, 400) 
    2628 
    27     dataSet = ( 
    28         ('bar.py', [[0, 180]]), 
    29         ('chart.py', [[0, 437]]), 
    30         ('color.py', [[0, 61]]), 
    31         ('line.py', [[0, 96]]), 
    32         ('pie.py', [[0, 187]]), 
    33         ) 
     29    dataSet = [(line[0], [[0, line[1]]]) for line in lines] 
    3430 
    3531    options = { 
    3632        'axis': { 
    3733            'x': { 
    38                 'ticks': [dict(v=i, label=d[0]) for i, d in enumerate(dataSet)], 
     34                'ticks': [dict(v=i, label=d[0]) for i, d in enumerate(lines)], 
    3935            } 
    4036        },