com.approximatrix.charting.render
Class BarChartRenderer

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

public class BarChartRenderer
extends AbstractChartRenderer

This renderer creates a 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  java.awt.Font barTopFont
           
protected  java.text.DecimalFormat barTopFormat
           
protected  float boxWidth
           
 
Fields inherited from class com.approximatrix.charting.render.AbstractChartRenderer
bounds, coord, listener, model, rcm, stopFlag
 
Constructor Summary
BarChartRenderer(CoordSystem cs, ChartDataModel model)
          Creates new BarChartRenderer
BarChartRenderer(CoordSystem cs, ChartDataModel model, java.text.DecimalFormat topFormat, java.awt.Font topFont, float boxWidth)
          Creates new BarChartRenderer
 
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

barTopFormat

protected java.text.DecimalFormat barTopFormat

boxWidth

protected float boxWidth

barTopFont

protected java.awt.Font barTopFont
Constructor Detail

BarChartRenderer

public BarChartRenderer(CoordSystem cs,
                        ChartDataModel model)
Creates new BarChartRenderer

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

BarChartRenderer

public BarChartRenderer(CoordSystem cs,
                        ChartDataModel model,
                        java.text.DecimalFormat topFormat,
                        java.awt.Font topFont,
                        float boxWidth)
Creates new BarChartRenderer

Parameters:
cs - the CoordSystem used to translate into pixel space
model - the DataModel that should be rendered
topFormat - if not null, the values that each box represents will be printed at the top of the box.
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