import barchart
class BarChart def __init__(self, datalist=None) string __module__ = 'barchart' def __str__(self) string GRAY2 = '#DDDDDD' def color_code(self, value) def gen_bar(self, value, color='blue') def gen_legend(self) def initialize(self) string WHITE = '#FFFFFF' def make_bar_cell(self, dict) int max_width = 400 def normalize(self) def pixels(self, magnitude) string attr_template = '' string CADETBLUE = '#9999CC' int day_month_order = 0
Class which takes a DataList object and creates the HTML to represent a color coded bar chart.
Values to be charted are limited to non-negative values.
datalist is an instance of class DataList
Generate HTML for the entire table and caption.
return a color string based on whether the given datum falls beyond thresholds. Works off self.thresholds=(low,hi).
return Image object for the scaled bar graphic
Return an HTML string which displays the legend for the chart.
Initialize the chart properties.
This method is overloaded by child classes.
return a TD object containing the scaled bar
Scale data to values between 0 and 400.
Determine peak value and set scale accordingly. If the values are clustered within 30% of each other, will shift the zero point for the barchart up to exagerate the value differences. To inhibit this, set the .bound_zero attribute to "yes".
returns the integer number of pixels to represent a given magnitude.
Copyright © Robin Friedrich
All Rights Reserved
Comments to author: dev@null
Generated: Tue Apr 20, 1999