org.romaframework.module.chart.jfreechart.helper
Class ChartHelper

java.lang.Object
  extended by org.romaframework.module.chart.jfreechart.helper.ChartHelper

public class ChartHelper
extends java.lang.Object

provides methods to render collections as charts

Author:
Luigi Dell'Aquila (luigi.dellaquila@assetdata.it)

Constructor Summary
ChartHelper()
           
 
Method Summary
static ChartRenderer generateChartRenderer(java.util.Collection<?> coll)
          creates a ChartRenderer object from a Collection
static ChartRenderer generateChartRenderer(java.util.Map<?,?> map)
          creates a ChartRenderer object from a Map
static void render(java.util.Collection<?> coll, java.io.OutputStream stream)
          renders a collection as a chart
static void render(java.util.Collection<?> coll, RenderOptions options, java.io.OutputStream stream)
          renders a collection as a chart
static void render(java.util.Map<?,?> map, java.io.OutputStream stream)
          renders a Map as a chart
static void render(java.util.Map<?,?> map, RenderOptions options, java.io.OutputStream stream)
          renders a Map as a chart
static void setLabelOrientation(org.jfree.chart.JFreeChart chart, RenderOptions options)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartHelper

public ChartHelper()
Method Detail

render

public static void render(java.util.Collection<?> coll,
                          java.io.OutputStream stream)
                   throws InvalidDataFormatException,
                          java.io.IOException
renders a collection as a chart

Parameters:
coll - the collection (must be a Collection<Number>, or a Collection<Collection<Number>> )
stream - the stream where the chart has to be written
Throws:
InvalidDataFormatException
java.io.IOException

render

public static void render(java.util.Collection<?> coll,
                          RenderOptions options,
                          java.io.OutputStream stream)
                   throws InvalidDataFormatException,
                          java.io.IOException
renders a collection as a chart

Parameters:
coll - the collection (must be a Collection<Number>, or a Collection<Collection<Number>> )
options - the options about how to render the chart
stream - the stream where the chart has to be written
Throws:
InvalidDataFormatException
java.io.IOException

render

public static void render(java.util.Map<?,?> map,
                          java.io.OutputStream stream)
                   throws InvalidDataFormatException,
                          java.io.IOException
renders a Map as a chart

Parameters:
map - the map to be rendered as a chart (must be a Map<Comparable, Number>, or a Map<Comparable, Map<Comparable, Number>> )
stream - the stream where the chart has to be written
Throws:
InvalidDataFormatException
java.io.IOException

render

public static void render(java.util.Map<?,?> map,
                          RenderOptions options,
                          java.io.OutputStream stream)
                   throws InvalidDataFormatException,
                          java.io.IOException
renders a Map as a chart

Parameters:
map - the map to be rendered as a chart (must be a Map<Comparable, Number>, or a Map<Comparable, Map<Comparable, Number>> )
options - the options about how to render the chart
stream - the stream where the chart has to be written
Throws:
InvalidDataFormatException
java.io.IOException

generateChartRenderer

public static ChartRenderer generateChartRenderer(java.util.Collection<?> coll)
                                           throws InvalidDataFormatException
creates a ChartRenderer object from a Collection

Parameters:
coll - the collection that must be transformed in a ChartRenderer (must be a Collection<Number>, or a Collection<Collection<Number>> )
Returns:
the ChartRenderer representation of the collection
Throws:
InvalidDataFormatException

generateChartRenderer

public static ChartRenderer generateChartRenderer(java.util.Map<?,?> map)
                                           throws InvalidDataFormatException
creates a ChartRenderer object from a Map

Parameters:
map - the Map that must be transformed in a ChartRenderer (must be a Map<Comparable, Number>, or a Map<Comparable, Map<Comparable, Number>> )
Returns:
the ChartRenderer representation of the Map
Throws:
InvalidDataFormatException

setLabelOrientation

public static void setLabelOrientation(org.jfree.chart.JFreeChart chart,
                                       RenderOptions options)