|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecthu.midori.kosmos.server.util.ChartUtils
public class ChartUtils
Utility methods for chart generation.
Field Summary | |
---|---|
static int |
MAX_ITEMS
Max number of items in trimmed datasets. |
protected static java.awt.Shape |
RECTANGLE_SHAPE
Shape for the timeseries-charts. |
protected static java.awt.Color |
TRANSPARENT_COLOR
Transparent paint used as background in chart images. |
Constructor Summary | |
---|---|
protected |
ChartUtils()
This class should never be instantiated. |
Method Summary | |
---|---|
static org.jfree.data.general.PieDataset |
collectionToPieDataset(java.util.Collection items)
Returns the passed collection as untrimmed pie-dataset. |
static org.jfree.data.general.PieDataset |
collectionToPieDataset(java.util.Collection items,
int maxItems)
Returns the passed collection of Map.Entry objects as pie-dataset
(equivalent key-value pairs), optionally trimmed to a maximum number of items
to prevent unreadably busy charts. |
static java.util.List |
countMapToSortedList(java.util.Map map)
Returns the list of the entries in the map sorted by their value (not by their key!) in descending order. |
static org.jfree.chart.JFreeChart |
generateColorCodedPieChart(org.jfree.data.general.PieDataset dataset)
Returns the color-coded pie-chart generated from the passed data. |
static org.jfree.chart.JFreeChart |
generatePieChart(org.jfree.data.general.PieDataset dataset)
Returns the pie-chart generated from the passed data. |
static org.jfree.chart.JFreeChart |
generateTimeBarChart(org.jfree.data.time.TimeSeries dataset)
Returns the time-barchart generated from the passed data. |
static org.jfree.chart.JFreeChart |
generateTimeLineChart(org.jfree.data.time.TimeSeries dataset)
Returns the time-chart generated from the passed data. |
static void |
incrementCountMap(java.util.Map<java.lang.String,java.lang.Integer> map,
java.lang.String key)
Increments the counter (or starts that from 1 if not existing yet) in a String to Integer map. |
static void |
writeChartAsPng(org.jfree.chart.JFreeChart chart,
java.io.OutputStream out,
int width,
int height)
Writes the given chart to the output-stream in PNG image format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int MAX_ITEMS
collectionToPieDataset(Collection, int)
,
Constant Field Valuesprotected static final java.awt.Color TRANSPARENT_COLOR
protected static final java.awt.Shape RECTANGLE_SHAPE
Constructor Detail |
---|
protected ChartUtils()
Method Detail |
---|
public static org.jfree.chart.JFreeChart generatePieChart(org.jfree.data.general.PieDataset dataset)
public static org.jfree.chart.JFreeChart generateColorCodedPieChart(org.jfree.data.general.PieDataset dataset)
ColorCodedKey
objects that
specify both the pie section labels and the pie section colors.
public static org.jfree.chart.JFreeChart generateTimeLineChart(org.jfree.data.time.TimeSeries dataset)
public static org.jfree.chart.JFreeChart generateTimeBarChart(org.jfree.data.time.TimeSeries dataset)
public static void writeChartAsPng(org.jfree.chart.JFreeChart chart, java.io.OutputStream out, int width, int height) throws java.io.IOException
java.io.IOException
public static org.jfree.data.general.PieDataset collectionToPieDataset(java.util.Collection items)
collectionToPieDataset(Collection, int)
public static org.jfree.data.general.PieDataset collectionToPieDataset(java.util.Collection items, int maxItems)
Map.Entry
objects as pie-dataset
(equivalent key-value pairs), optionally trimmed to a maximum number of items
to prevent unreadably busy charts.
maxItems
- the maximum number of items in the returned pie-dataset or -1 if trimming is not needed.public static void incrementCountMap(java.util.Map<java.lang.String,java.lang.Integer> map, java.lang.String key)
String
to Integer
map.
public static java.util.List countMapToSortedList(java.util.Map map)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |