Previous blank.gif blank.gif blank.gif

Class StackedBarChart


SYNOPSIS

import barchart
class StackedBarChart(BarChart)
  string __module__ = 'barchart'
  def gen_bar(self, values, colors)
  def gen_legend(self)
  def initialize(self)
  def make_bar_cell(self, dict)
  def segment(self, value, color='blue')

  # Methods inherited by StackedBarChart from BarChart
  def __init__(self, datalist=None)
  def __str__(self)
  def color_code(self, value)
  def normalize(self)
  def pixels(self, magnitude)

DESCRIPTION

Represent up to six data values in a stacked barchart.

def __init__(self, datalist=None)

datalist is an instance of class DataList

def __str__(self)

Generate HTML for the entire table and caption.

def color_code(self, value)

return a color string based on whether the given datum falls beyond thresholds. Works off self.thresholds=(low,hi).

def gen_bar(self, values, colors)

return HTML string for the stacked bar graphic.

def gen_legend(self)

Return an HTML string which displays the legend for the chart.

def initialize(self)

Define StackedBarChart specific attributes.

def make_bar_cell(self, dict)

return a TD object containing the scaled bar

def normalize(self)

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".

def pixels(self, magnitude)

returns the integer number of pixels to represent a given magnitude.

def segment(self, value, color='blue')

return HTML string for a bar segment given a magnitude and color.

SEE ALSO

barchart

BarChart


Previous blank.gif blank.gif blank.gif
Buzz.gif

Copyright © Robin Friedrich
All Rights Reserved
Comments to author: dev@null
Generated: Tue Apr 20, 1999