Changes between Version 8 and Version 9 of Charts


Ignore:
Timestamp:
Dec 23, 2009, 1:27:38 AM (15 years ago)
Author:
bugmenot
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Charts

    v8 v9  
    8282    #extract the request params of interest.
    8383    #I suggest having a default for everything.
    84     if request.has_key('height'):
     84    if 'height' in request:
    8585        d.height = int(request['height'])
    86     if request.has_key('width'):
     86    if 'width' in request:
    8787        d.width = int(request['width'])
    8888   
    89     if request.has_key('numbers'):
     89    if 'numbers' in request:
    9090        strNumbers = request['numbers']
    9191        numbers = map(int, strNumbers.split(','))   
    9292        d.chart.data = [numbers]   #bar charts take a list-of-lists for data
    9393
    94     if request.has_key('title'):
     94    if 'title' in request:
    9595        d.title.text = request['title']
    9696 
     
    232232    labels =  ["Label One","Label Two"]
    233233    if labels:
    234         cnt=0
    235234        # set colors in the legend
    236235        d.Legend.colorNamePairs = []
    237         for label in labels:
     236        for cnt,label in enumerate(labels):
    238237                d.Legend.colorNamePairs.append((d.chart.lines[cnt].strokeColor,label))
    239                 cnt=cnt+1
    240238
    241239
Back to Top