com.approximatrix.charting.render
Class StackedBarChartRenderer

java.lang.Object
  extended by com.approximatrix.charting.render.AbstractChartRenderer
      extended by com.approximatrix.charting.render.StackedBarChartRenderer
All Implemented Interfaces:
Renderer

public class StackedBarChartRenderer
extends AbstractChartRenderer

This renderer creates a stacked BarChart. This will only work on a ChartDataModel with non-numeric x-axis values, because I couldn't make any sense out of a bar chart with a numeric x-axis like in a line chart.

Version:
1.0
Author:
mueller

Field Summary
protected  float boxWidth
           
 
Fields inherited from class com.approximatrix.charting.render.AbstractChartRenderer
bounds, coord, listener, model, rcm, stopFlag
 
Constructor Summary
StackedBarChartRenderer(CoordSystem cs, AbstractChartDataModel model)
          Creates new StackedBarChartRenderer
StackedBarChartRenderer(CoordSystem cs, AbstractChartDataModel model, float boxWidth)
          Creates new StackedBarChartRenderer
 
Method Summary
 void renderChart(java.awt.Graphics2D g)
          Finally renders the Object in the Graphics object.
 
Methods inherited from class com.approximatrix.charting.render.AbstractChartRenderer
addRenderChangeListener, clearRenderChangeListeners, fireRenderChangeEvent, getBounds, getChartDataModel, getCoordSystem, getPreferredSize, getRowColorModel, getTransform, interruptRendering, removeRenderChangeListener, render, resetStopFlag, setBounds, setChartDataModel, setCoordSystem, setRowColorModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

boxWidth

protected float boxWidth
Constructor Detail

StackedBarChartRenderer

public StackedBarChartRenderer(CoordSystem cs,
                               AbstractChartDataModel model)
Creates new StackedBarChartRenderer

Parameters:
cs - the ClassicCoordSystem used to translate into pixel space
model - the DataModel that should be rendered

StackedBarChartRenderer

public StackedBarChartRenderer(CoordSystem cs,
                               AbstractChartDataModel model,
                               float boxWidth)
Creates new StackedBarChartRenderer

Parameters:
cs - the ClassicCoordSystem used to translate into pixel space
model - the DataModel that should be rendered
boxWidth - a value between 0.0 and 1.0 representing how much of the alloted space each box should consume. If 1.0 is passed, then each box will completely fill it's allotted space, alternately I suggest you don't pass 0.0
Method Detail

renderChart

public void renderChart(java.awt.Graphics2D g)
Finally renders the Object in the Graphics object.

Specified by:
renderChart in class AbstractChartRenderer
Parameters:
g - the Graphics2D object in which to render