com.ebay.carad.os.vitalsigns.util
Class ChartUtil

java.lang.Object
  extended by com.ebay.carad.os.vitalsigns.util.ChartUtil

public abstract class ChartUtil
extends java.lang.Object

This class produces a time-series chart, and saves it as a JPEG to the specified location.

Version:
$Id$
Author:
Jeremy Thomerson, Jeremy Kraybill

Field Summary
private static java.lang.String CURRENT_DAY_LABEL
          Label string for legends.
private static java.lang.String CURRENT_HOUR_LABEL
          Label string for legends.
private static java.lang.String CURRENT_MONTH_LABEL
          Label string for legends.
private static java.lang.String CURRENT_WEEK_LABEL
          Label string for legends.
private static java.lang.String CURRENT_YEAR_LABEL
          Label string for legends.
static java.util.List DAYLEGEND
          Legend for day charts.
static java.util.List HOURLEGEND
          Legend for hour charts.
private static org.apache.log4j.Logger LOGGER
          Class logger.
static java.util.List MONTHLEGEND
          Legend for month charts.
private static java.lang.String ONE_DAY_AGO_LABEL
          Label string for legends.
private static java.lang.String ONE_MONTH_AGO_LABEL
          Label string for legends.
private static java.lang.String ONE_WEEK_AGO_LABEL
          Label string for legends.
private static java.lang.String ONE_YEAR_AGO_LABEL
          Label string for legends.
static java.util.List WEEKLEGEND
          Legend for week charts.
static java.util.List YEARLEGEND
          Legend for year charts.
 
Constructor Summary
ChartUtil()
           
 
Method Summary
private static void encode(java.awt.image.BufferedImage img, java.io.OutputStream out, float quality)
           
static void saveChart(org.jfree.chart.JFreeChart chart, java.lang.String path, int width, int height)
          Saves the given chart to the given destination JPG file at 85% quality.
static void saveChart(org.jfree.chart.JFreeChart chart, java.lang.String path, int width, int height, float quality)
          Saves the given chart to the given destination JPG file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

private static final org.apache.log4j.Logger LOGGER
Class logger.


CURRENT_HOUR_LABEL

private static final java.lang.String CURRENT_HOUR_LABEL
Label string for legends.

See Also:
Constant Field Values

CURRENT_DAY_LABEL

private static final java.lang.String CURRENT_DAY_LABEL
Label string for legends.

See Also:
Constant Field Values

CURRENT_WEEK_LABEL

private static final java.lang.String CURRENT_WEEK_LABEL
Label string for legends.

See Also:
Constant Field Values

CURRENT_MONTH_LABEL

private static final java.lang.String CURRENT_MONTH_LABEL
Label string for legends.

See Also:
Constant Field Values

CURRENT_YEAR_LABEL

private static final java.lang.String CURRENT_YEAR_LABEL
Label string for legends.

See Also:
Constant Field Values

ONE_DAY_AGO_LABEL

private static final java.lang.String ONE_DAY_AGO_LABEL
Label string for legends.

See Also:
Constant Field Values

ONE_WEEK_AGO_LABEL

private static final java.lang.String ONE_WEEK_AGO_LABEL
Label string for legends.

See Also:
Constant Field Values

ONE_MONTH_AGO_LABEL

private static final java.lang.String ONE_MONTH_AGO_LABEL
Label string for legends.

See Also:
Constant Field Values

ONE_YEAR_AGO_LABEL

private static final java.lang.String ONE_YEAR_AGO_LABEL
Label string for legends.

See Also:
Constant Field Values

HOURLEGEND

public static final java.util.List HOURLEGEND
Legend for hour charts.


DAYLEGEND

public static final java.util.List DAYLEGEND
Legend for day charts.


WEEKLEGEND

public static final java.util.List WEEKLEGEND
Legend for week charts.


MONTHLEGEND

public static final java.util.List MONTHLEGEND
Legend for month charts.


YEARLEGEND

public static final java.util.List YEARLEGEND
Legend for year charts.

Constructor Detail

ChartUtil

public ChartUtil()
Method Detail

encode

private static void encode(java.awt.image.BufferedImage img,
                           java.io.OutputStream out,
                           float quality)
                    throws java.io.IOException
Throws:
java.io.IOException

saveChart

public static void saveChart(org.jfree.chart.JFreeChart chart,
                             java.lang.String path,
                             int width,
                             int height)
Saves the given chart to the given destination JPG file at 85% quality.

Parameters:
chart - the chart to save
path - the path of the image to save to
width - the width of the image in pixels
height - the height of the image in pixes

saveChart

public static void saveChart(org.jfree.chart.JFreeChart chart,
                             java.lang.String path,
                             int width,
                             int height,
                             float quality)
Saves the given chart to the given destination JPG file.

Parameters:
chart - the chart to save
path - the path of the image to save to
width - the width of the image in pixels
height - the height of the image in pixes
quality - the quality of the JPG, from 0 to 1.


Copyright © 2004-2009. All Rights Reserved.