Changes between Version 8 and Version 9 of Charts
- Timestamp:
- Dec 23, 2009, 1:27:38 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Charts
v8 v9 82 82 #extract the request params of interest. 83 83 #I suggest having a default for everything. 84 if request.has_key('height'):84 if 'height' in request: 85 85 d.height = int(request['height']) 86 if request.has_key('width'):86 if 'width' in request: 87 87 d.width = int(request['width']) 88 88 89 if request.has_key('numbers'):89 if 'numbers' in request: 90 90 strNumbers = request['numbers'] 91 91 numbers = map(int, strNumbers.split(',')) 92 92 d.chart.data = [numbers] #bar charts take a list-of-lists for data 93 93 94 if request.has_key('title'):94 if 'title' in request: 95 95 d.title.text = request['title'] 96 96 … … 232 232 labels = ["Label One","Label Two"] 233 233 if labels: 234 cnt=0235 234 # set colors in the legend 236 235 d.Legend.colorNamePairs = [] 237 for label in labels:236 for cnt,label in enumerate(labels): 238 237 d.Legend.colorNamePairs.append((d.chart.lines[cnt].strokeColor,label)) 239 cnt=cnt+1240 238 241 239