com.urbancode.anthill3.domain.reporting.graphing
Class GraphicsHelper

java.lang.Object
  extended by com.urbancode.anthill3.domain.reporting.graphing.GraphicsHelper

public class GraphicsHelper
extends java.lang.Object


Constructor Summary
GraphicsHelper()
          Default Constructor
 
Method Summary
static de.laures.cewolf.taglib.AbstractChartDefinition createChart(de.laures.cewolf.DatasetProducer producer, java.lang.String type, java.lang.String title, java.lang.String xAxisLabel, java.lang.String yAxisLabel, java.util.HashMap dataproducerParams)
           
static de.laures.cewolf.taglib.AbstractChartDefinition createChart(de.laures.cewolf.DatasetProducer producer, java.lang.String type, java.lang.String title, java.lang.String xAxisLabel, java.lang.String yAxisLabel, java.util.HashMap dataproducerParams, java.awt.Color[] colors)
           
static de.laures.cewolf.taglib.AbstractChartDefinition createPieChart(java.util.Map<java.lang.String,java.lang.Double> dataMap, java.lang.String title, boolean is3d)
           
static de.laures.cewolf.taglib.AbstractChartDefinition createSuccessFailPieChart2d(int success, int failure, int other)
           
static de.laures.cewolf.taglib.AbstractChartDefinition createSuccessFailPieChart3d(int success, int failure, int other)
           
static java.lang.String getChartUrlString(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, de.laures.cewolf.taglib.AbstractChartDefinition chart, int width, int height)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphicsHelper

public GraphicsHelper()
Default Constructor

Method Detail

getChartUrlString

public static java.lang.String getChartUrlString(javax.servlet.http.HttpServletRequest request,
                                                 javax.servlet.http.HttpServletResponse response,
                                                 de.laures.cewolf.taglib.AbstractChartDefinition chart,
                                                 int width,
                                                 int height)
                                          throws de.laures.cewolf.CewolfException
Parameters:
request - The request for this view
response - The response object for this view
chart - A chart definition created by the createChart method
width - The width of the image in pixels
height - The height of the image in pixels
Throws:
de.laures.cewolf.CewolfException

createChart

public static de.laures.cewolf.taglib.AbstractChartDefinition createChart(de.laures.cewolf.DatasetProducer producer,
                                                                          java.lang.String type,
                                                                          java.lang.String title,
                                                                          java.lang.String xAxisLabel,
                                                                          java.lang.String yAxisLabel,
                                                                          java.util.HashMap dataproducerParams)
Parameters:
producer - ReportDataProducer reccommended
type - Type of the chart. One of area, areaxy, horizontalbar, horizontalbar3d, line, pie, scatter, stackedhorizontalbar, stackedverticalbar, stackedverticalbar3d, timeseries, verticalbar, verticalbar3d, xy, candlestick, highlow, gantt, wind, signal, verticalxybar, pie3d
title - The title for the chart
xAxisLabel - the description of the 'x' axis
yAxisLabel - the description of the 'y' axis
Returns:
A chart defintion that can be passed to the image helper.

createChart

public static de.laures.cewolf.taglib.AbstractChartDefinition createChart(de.laures.cewolf.DatasetProducer producer,
                                                                          java.lang.String type,
                                                                          java.lang.String title,
                                                                          java.lang.String xAxisLabel,
                                                                          java.lang.String yAxisLabel,
                                                                          java.util.HashMap dataproducerParams,
                                                                          java.awt.Color[] colors)
Parameters:
producer - ReportDataProducer reccommended
type - Type of the chart. One of area, areaxy, horizontalbar, horizontalbar3d, line, pie, scatter, stackedhorizontalbar, stackedverticalbar, stackedverticalbar3d, timeseries, verticalbar, verticalbar3d, xy, candlestick, highlow, gantt, wind, signal, verticalxybar, pie3d
title - The title for the chart
xAxisLabel - the description of the 'x' axis
yAxisLabel - the description of the 'y' axis
Returns:
A chart defintion that can be passed to the image helper.

createSuccessFailPieChart2d

public static de.laures.cewolf.taglib.AbstractChartDefinition createSuccessFailPieChart2d(int success,
                                                                                          int failure,
                                                                                          int other)
Parameters:
success - the number of successful tests
failure - the number of failed tests
other - the number of tests which are not success or failure (e.g. not-run)
Returns:
a chart definition for a 2d pie chart with success in green and failure in red

createSuccessFailPieChart3d

public static de.laures.cewolf.taglib.AbstractChartDefinition createSuccessFailPieChart3d(int success,
                                                                                          int failure,
                                                                                          int other)
Parameters:
success - the number of successful tests
failure - the number of failed tests
other - the number of tests which are not success or failure (e.g. not-run)
Returns:
a chart definition for a 3d pie chart with success in green and failure in red

createPieChart

public static de.laures.cewolf.taglib.AbstractChartDefinition createPieChart(java.util.Map<java.lang.String,java.lang.Double> dataMap,
                                                                             java.lang.String title,
                                                                             boolean is3d)
Parameters:
dataMap - a map of values by name to render as a chart
is3d - if the chart should be a 3d pie chart or a 2d chart
Returns:
a chart definition for a pie chart with success in green and failure in red