Package org.opennms.web.charts
Class ChartUtils
- java.lang.Object
-
- org.opennms.web.charts.ChartUtils
-
public abstract class ChartUtils extends java.lang.ObjectChartUtils class.
- Version:
- $Id: $
- Author:
- David Hustace
-
-
Constructor Summary
Constructors Constructor Description ChartUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.jfree.chart.JFreeChartgetBarChart(java.lang.String chartName)This method will returns a JFreeChart bar chart constructed based on XML configuration.static voidgetBarChart(java.lang.String chartName, java.io.OutputStream out)Helper method that returns the JFreeChart to an output stream written in JPEG format.static byte[]getBarChartAsPNGByteArray(java.lang.String chartName)Helper method that returns the JFreeChart as a PNG byte array.static BarChartgetBarChartConfigByName(java.lang.String chartName)Helper method used to retrieve the XML defined BarChartstatic voidgetBarChartPNG(java.lang.String chartName, java.io.OutputStream out)Helper method that returns the JFreeChart to an output stream written in JPEG format.static java.awt.image.BufferedImagegetChartAsBufferedImage(java.lang.String chartName)Helper method used to return a JFreeChart as a buffered Image.static java.util.Collection<BarChart>getChartCollection()Helper method used to fetch an Iterator for all defined Chartsstatic java.util.Iterator<BarChart>getChartCollectionIterator()Helper method used to fetch an Iterator for all defined Charts
-
-
-
Method Detail
-
getBarChart
public static org.jfree.chart.JFreeChart getBarChart(java.lang.String chartName) throws java.io.IOException, java.sql.SQLExceptionThis method will returns a JFreeChart bar chart constructed based on XML configuration.- Parameters:
chartName- Name specified in chart-configuration.xml- Returns:
JFreeChartconstructed from the chartName- Throws:
java.io.IOException- if any.java.sql.SQLException- if any.
-
getBarChart
public static void getBarChart(java.lang.String chartName, java.io.OutputStream out) throws java.io.IOException, java.sql.SQLExceptionHelper method that returns the JFreeChart to an output stream written in JPEG format.- Parameters:
chartName- aStringobject.out- aOutputStreamobject.- Throws:
java.io.IOException- if any.java.sql.SQLException- if any.
-
getBarChartPNG
public static void getBarChartPNG(java.lang.String chartName, java.io.OutputStream out) throws java.io.IOException, java.sql.SQLExceptionHelper method that returns the JFreeChart to an output stream written in JPEG format.- Parameters:
chartName- aStringobject.out- aOutputStreamobject.- Throws:
java.io.IOException- if any.java.sql.SQLException- if any.
-
getBarChartAsPNGByteArray
public static byte[] getBarChartAsPNGByteArray(java.lang.String chartName) throws java.io.IOException, java.sql.SQLExceptionHelper method that returns the JFreeChart as a PNG byte array.- Parameters:
chartName- aStringobject.- Returns:
- a byte array
- Throws:
java.io.IOException- if any.java.sql.SQLException- if any.
-
getChartAsBufferedImage
public static java.awt.image.BufferedImage getChartAsBufferedImage(java.lang.String chartName) throws java.io.IOException, java.sql.SQLExceptionHelper method used to return a JFreeChart as a buffered Image.- Parameters:
chartName- aStringobject.- Returns:
- a
BufferedImage - Throws:
java.io.IOException- if any.java.sql.SQLException- if any.
-
getBarChartConfigByName
public static BarChart getBarChartConfigByName(java.lang.String chartName) throws java.io.IOException
Helper method used to retrieve the XML defined BarChart- Parameters:
chartName- aStringobject.- Returns:
- a BarChart
- Throws:
java.io.IOException- if any.
-
getChartCollection
public static java.util.Collection<BarChart> getChartCollection() throws java.io.IOException
Helper method used to fetch an Iterator for all defined Charts- Returns:
BarChartIterator- Throws:
java.io.IOException- if any.
-
getChartCollectionIterator
public static java.util.Iterator<BarChart> getChartCollectionIterator() throws java.io.IOException
Helper method used to fetch an Iterator for all defined Charts- Returns:
BarChartIterator- Throws:
java.io.IOException- if any.
-
-