|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hackystat.projectbrowser.googlechart.GoogleChart
public class GoogleChart
Chart class that represent a chart image that generated from Google Chart API.
Field Summary | |
---|---|
static java.lang.String |
DATAITEM_SEPARATOR
character that separate data items in a data set. |
static java.lang.String |
DATASET_SEPARATOR
character that separate data sets. |
static java.lang.String |
GOOGLECHART_API_URL
host of google chart service. |
static int |
MAX_SIZE
The maximum size of a google chart. |
static java.lang.String |
PARAMETER_SEPARATOR
character that separate parameter. |
Constructor Summary | |
---|---|
GoogleChart(ChartType chartType,
int width,
int height)
initialize the chart with indispensable parameter. |
Method Summary | |
---|---|
void |
addAxisLabel(java.lang.String type)
add a label with default label values. |
void |
addAxisLabel(java.lang.String type,
java.util.List<java.lang.String> labels,
java.lang.String color)
add a label with given label values. |
void |
addAxisRange(java.lang.String type,
java.util.List<java.lang.Double> range,
java.lang.String color)
add a label with given label range. |
void |
addColor(java.awt.Color color)
add the color to color list. |
void |
addColor(java.lang.String color)
add the color to color list. |
void |
addLineStyle(double thickness,
double lineLength,
double blankLength)
add a line style with the given parameters. |
static java.lang.String |
colorToString(java.awt.Color color)
convert a Color object to a String, with format of RRGGBB. |
java.lang.String |
getBackgroundColor()
|
java.util.List<java.util.List<java.lang.Double>> |
getChartData()
|
java.util.List<java.util.List<java.lang.Double>> |
getChartDataScale()
|
java.util.List<java.lang.String> |
getChartLegend()
|
java.util.List<java.lang.String> |
getChartMarker()
|
ChartType |
getChartType()
|
java.util.List<java.lang.String> |
getColors()
|
int |
getHeight()
|
java.util.List<java.lang.String> |
getMarkerColors()
|
static java.lang.String |
getNextJetColor()
|
static java.lang.String |
getNextMarker()
Return the next available marker. |
static java.lang.String |
getRandomColor()
|
static java.lang.String |
getRandomMarker()
|
java.lang.String |
getTitle()
|
java.lang.String |
getUrl()
Return the URL that represent this chart from Google Chart API. |
int |
getWidth()
|
boolean |
isYAxisEmpty()
|
void |
setBackgroundColor(java.lang.String backgroundColor)
|
void |
setBarChartSize(int barHeight,
int groupSpace,
int barSpace)
Set the size of the bar chart. |
void |
setChartData(java.util.List<java.util.List<java.lang.Double>> chartData)
|
void |
setChartDataScale(java.util.List<java.util.List<java.lang.Double>> chartDataScale)
|
void |
setChartType(ChartType chartType)
|
void |
setHeight(int height)
|
void |
setMarkerColors(java.util.List<java.lang.String> markerColors)
|
void |
setTitle(java.lang.String title)
|
void |
setWidth(int width)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String GOOGLECHART_API_URL
public static final java.lang.String PARAMETER_SEPARATOR
public static final java.lang.String DATASET_SEPARATOR
public static final java.lang.String DATAITEM_SEPARATOR
public static final int MAX_SIZE
Constructor Detail |
---|
public GoogleChart(ChartType chartType, int width, int height)
chartType
- type of this chart.width
- width.height
- height.Method Detail |
---|
public static java.lang.String getNextMarker()
public java.lang.String getUrl()
public static java.lang.String colorToString(java.awt.Color color)
color
- the Color to be convert.
public void setWidth(int width)
width
- the width to setpublic int getWidth()
public void setHeight(int height)
height
- the height to setpublic int getHeight()
public void setChartType(ChartType chartType)
chartType
- the chartType to setpublic ChartType getChartType()
public void setChartData(java.util.List<java.util.List<java.lang.Double>> chartData)
chartData
- the chartData to setpublic java.util.List<java.util.List<java.lang.Double>> getChartData()
public void setChartDataScale(java.util.List<java.util.List<java.lang.Double>> chartDataScale)
chartDataScale
- the chartDataScale to setpublic java.util.List<java.util.List<java.lang.Double>> getChartDataScale()
public java.util.List<java.lang.String> getColors()
public void addColor(java.lang.String color)
color
- String that represent the color in format RRGGBB.public void addColor(java.awt.Color color)
color
- the Color to add.public void setTitle(java.lang.String title)
title
- the title to setpublic java.lang.String getTitle()
public void addAxisLabel(java.lang.String type)
type
- axis label type, either x, t, y, or r.public void addAxisLabel(java.lang.String type, java.util.List<java.lang.String> labels, java.lang.String color)
type
- axis label type, either x, t, y, or r.labels
- the given label values.color
- the axis color.public void addAxisRange(java.lang.String type, java.util.List<java.lang.Double> range, java.lang.String color)
type
- axis label type, either x, t, y, or r.range
- the given range.color
- the axis color.public void addLineStyle(double thickness, double lineLength, double blankLength)
thickness
- thickness of the line.lineLength
- length of the line segment.blankLength
- length of the blank segment.public boolean isYAxisEmpty()
public java.util.List<java.lang.String> getChartMarker()
public java.util.List<java.lang.String> getChartLegend()
public static java.lang.String getRandomColor()
public static java.lang.String getRandomMarker()
public void setMarkerColors(java.util.List<java.lang.String> markerColors)
markerColors
- the markerColors to setpublic java.util.List<java.lang.String> getMarkerColors()
public void setBarChartSize(int barHeight, int groupSpace, int barSpace)
barHeight
- the height or width of the bar.groupSpace
- the space between groups.barSpace
- the space between bars in a group.public void setBackgroundColor(java.lang.String backgroundColor)
backgroundColor
- the backgroundColor to setpublic java.lang.String getBackgroundColor()
public static java.lang.String getNextJetColor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |