public abstract class Chart extends WebImage
Image| Modifier and Type | Field and Description |
|---|---|
protected static String |
ARG_MUST_BE_ZERO_OR_GREATER |
Color |
averageLineColor
Color of the average data point horizontal line.
|
protected static String |
AVG |
double |
baseline
Baseline in the chart.
|
protected static String |
BASELINE |
Color |
baselineColor
Color of the baseline horizontal line.
|
double |
ceiling
Top number for the left axis of the chart.
|
Color |
chartColor
Retrieves the chart's interior background color.
|
protected static Font |
DEFAULT_LABEL_FONT |
protected static Font |
DEFAULT_LEGEND_FONT |
protected static Font |
DEFAULT_LEGEND_PLAIN |
protected static String |
DEFAULT_UNIT_LEGEND |
protected static String |
DEFAULT_VALUE_LEGEND |
static String |
EMPTY_STRING |
double |
floor
Bottom number for the left axis of the chart.
|
double |
highRange
High range in the chart.
|
Color |
highRangeColor
High range color in the chart.
|
Font |
legendFont
Font that is used to draw the legend for the chart's X and Y axis.
|
Color |
legendTextColor
Color that is used to draw the legend text for the chart's X and Y axis.
|
int |
lineWidth
Width of lines in the chart.
|
protected static String |
LOW |
Color |
lowLineColor
Retrieves the color of the low data point horizontal line.
|
double |
lowRange
Low range in the chart.
|
Color |
lowRangeColor
High range color in the chart.
|
protected double[] |
m_adRangeMarks |
protected boolean |
m_bNoData |
protected double |
m_dAvgValue |
protected double |
m_dLowValue |
protected double |
m_dPeakValue |
protected double |
m_floor |
protected org.rhq.core.domain.measurement.MeasurementUnits |
m_fmtUnits |
protected FontMetrics |
m_metricsLabel |
protected FontMetrics |
m_metricsLegend |
protected static String |
PEAK |
Color |
peakLineColor
Color of the peak data point horizontal line.
|
int |
rightLabelWidth
Sets a fixed size for the label width on the right vertical axis.
|
boolean |
showAverage
Calculates and shows an Average line in the chart.
|
boolean |
showBaseline
Shows a Baseline in the chart.
|
boolean |
showBottomLabels
Shows labels on the X axis bottom side.
|
boolean |
showBottomLegend
Shows a top legend.
|
boolean |
showFullLabels
Show full labels on the bottom x axis.
|
boolean |
showHighRange
Shows a shaded high range in the chart.
|
boolean |
showLeftLabels
Shows labels on the Y axis left side.
|
boolean |
showLeftLegend
Shows a Left legend.
|
boolean |
showLow
Calculates and shows a Low line in the chart.
|
boolean |
showLowRange
Shows a shaded low range in the chart.
|
boolean |
showPeak
Calculates and shows a peak line in the chart.
|
boolean |
showRightLabels
Shows labels on the Y axis right side.
|
boolean |
showRightLegend
Shows a Right legend.
|
boolean |
showTopLabels
Shows labels on the X axis top side.
|
boolean |
showTopLegend
Shows a top legend.
|
boolean |
showUnitLines
Shows vertical crossing lines at each data point on the y axis.
|
boolean |
showValueLines
Shows horizontal crossing lines at each data point on the x axis.
|
boolean |
showValues
Shows values.
|
int |
textWhitespace
The width of the white space between tick marks and the label text.
|
int |
tickMarkHeight
The height, in pixels, of the tick mark lines that extend outside the chart's border.
|
int |
valueIndent
Number of pixels to indent the value axis.
|
int |
valueLines
Number of value lines that the chart draws at data points along the chart's value axis.
|
protected static int |
VARIABLE_HEIGHT |
protected static int |
VARIABLE_WIDTH |
int |
x2VertLabels |
int |
x2VertMarks |
int |
xLabelsSkip |
Color |
xLineColor
Color of the border lines, horizontal lines and tick marks
|
int |
xOffset
Amount to offset the chart on the X axis in pixels.
|
int |
xRLabel |
int |
xVertLegend |
int |
xVertMarks |
int |
yBottomLegend |
int |
yHorzLabels |
int |
yOffset
Amount to offset the chart on the Y axis in pixels.
|
int |
yTopLegend |
antiAliased, ARG_CANNOT_BE_NULL, backgroundColor, bottomBorder, DEFAULT_BACKGROUND_COLOR, DEFAULT_BOLD_TYPEFACE, DEFAULT_BORDER_COLOR, DEFAULT_BORDER_SIZE, DEFAULT_FONT, DEFAULT_FONT_METRICS, DEFAULT_HEIGHT, DEFAULT_PLAIN_TYPEFACE, DEFAULT_SHADOW_WIDTH, DEFAULT_WIDTH, font, frameImage, height, indexColors, leftBorder, m_graphics, rightBorder, shadowWidth, SMALL_FONT, textColor, topBorder, width| Modifier | Constructor and Description |
|---|---|
protected |
Chart()
Constructs a Chart class with a default width of 755 pixels and a default height of 300 pixels.
|
protected |
Chart(int charts)
Constructs a Chart class with a default width of 755 pixels and a default height of 300 pixels.
|
protected |
Chart(int width,
int height)
Constructs a Chart class with a specified width and height.
|
protected |
Chart(int width,
int height,
int charts)
Constructs a Chart class with a specified width and height.
|
| Modifier and Type | Method and Description |
|---|---|
protected Rectangle |
adjustRectangle(Graphics2D g,
Rectangle rect)
Give the child class an opportunity to change the size of the interior rectangle.
|
protected void |
calc(Graphics2D g) |
protected void |
calcRanges()
Calculates the high, low and average values of the chart data set.
|
protected int |
calcVariableHeight() |
protected int |
calcVariableWidth() |
protected boolean |
checkHighLow() |
protected Rectangle |
draw(ChartGraphics g) |
protected void |
draw(Graphics2D g) |
double |
getAverageValue()
Retrieves the average value of the chart's data set.
|
protected Class<DataPointCollection> |
getDataCollectionClass() |
protected Point |
getDataPoint(int valuePixels,
int unitPixels,
int datapoint,
DataPointCollection coll)
Retrieves the value and unit coordinate for a data point in the chart.
|
DataPointCollection |
getDataPoints()
Retrieves the data set of the chart.
|
DataPointCollection |
getDataPoints(int index) |
int |
getDataSetCount() |
Iterator<DataPointCollection> |
getDataSetIterator() |
protected Point |
getDisplayPoint(int valuePixels,
int unitPixels,
int unitPoints,
double value,
int unitIndex)
Retrieves the value and unit coordinate for a value on the x and y axis in the chart.
|
protected int |
getExteriorHeight() |
Rectangle |
getExteriorRectangle() |
protected abstract Rectangle |
getInteriorRectangle(ChartGraphics g) |
double |
getLowValue()
Retrieves the low value of the chart's data set.
|
String |
getNoDataString() |
double |
getPeakValue()
Retrieves the peak value of the chart's data set.
|
String |
getTitle()
Get the chart's title.
|
protected String |
getUnitLabel(IDisplayDataPoint data) |
String |
getUnitLegend()
Retrieves the legend for the chart's Unit axis.
|
String |
getValueLegend()
Retrieves the legend for the chart's Value axis.
|
protected int |
getXLabelHeight() |
protected abstract String[] |
getXLabels() |
protected int |
getXLabelWidth()
Calculates the label width of the horizontal axis of the chart.
|
protected int |
getXLegendHeight() |
protected abstract int |
getYLabelWidth(Graphics2D g)
Calculates the label width of the vertical axis of the chart.
|
protected boolean |
hasData() |
protected Collection<DataPointCollection> |
initData(Collection<DataPointCollection> coll) |
protected void |
initFonts() |
protected void |
postInit(Graphics2D g) |
protected void |
preInit() |
protected double |
scale(int height)
Calculates the scale of the graph data points.
|
void |
setFormat(org.rhq.core.domain.measurement.MeasurementUnits units) |
void |
setNoDataString(String s) |
void |
setNumberDataSets(int number) |
void |
setTitle(String title)
Set the chart's title.
|
void |
setUnitLegend(String legend)
Sets the legend for the chart's Unit axis.
|
void |
setValueLegend(String legend)
Sets the legend for the chart's Value axis.
|
getFontMetrics, getImage, getTextCenter, getTextCenter, getTextCenter, isRunnable, setBorder, writeJpegImage, writeJpegImage, writePngImage, writePngImagepublic static final String EMPTY_STRING
protected static final String ARG_MUST_BE_ZERO_OR_GREATER
protected static final String AVG
protected static final String BASELINE
protected static final String LOW
protected static final String PEAK
protected static final String DEFAULT_UNIT_LEGEND
protected static final String DEFAULT_VALUE_LEGEND
protected static final int VARIABLE_HEIGHT
protected static final int VARIABLE_WIDTH
protected static final Font DEFAULT_LABEL_FONT
protected static final Font DEFAULT_LEGEND_PLAIN
protected static final Font DEFAULT_LEGEND_FONT
protected FontMetrics m_metricsLabel
protected FontMetrics m_metricsLegend
protected org.rhq.core.domain.measurement.MeasurementUnits m_fmtUnits
protected double m_dAvgValue
protected double m_dLowValue
protected double m_dPeakValue
protected double[] m_adRangeMarks
protected double m_floor
protected boolean m_bNoData
public int yTopLegend
public int yBottomLegend
public int xVertLegend
public int yHorzLabels
public int x2VertLabels
public int xRLabel
public int xVertMarks
public int x2VertMarks
public int xLabelsSkip
public Color averageLineColor
public Color baselineColor
public double ceiling
public Color chartColor
public double floor
public double baseline
public double highRange
public Color highRangeColor
public Font legendFont
public Color legendTextColor
public int lineWidth
public Color lowLineColor
public double lowRange
public Color lowRangeColor
public Color peakLineColor
public int rightLabelWidth
public boolean showAverage
public boolean showBaseline
public boolean showBottomLabels
public boolean showBottomLegend
public boolean showFullLabels
public boolean showHighRange
public boolean showLeftLabels
public boolean showLeftLegend
public boolean showLow
public boolean showLowRange
public boolean showPeak
public boolean showRightLabels
public boolean showRightLegend
public boolean showTopLabels
public boolean showTopLegend
public boolean showUnitLines
public boolean showValueLines
public boolean showValues
public int textWhitespace
public int tickMarkHeight
public int valueIndent
public int valueLines
public Color xLineColor
public int xOffset
public int yOffset
protected Chart()
protected Chart(int charts)
charts - The number of charts to display.protected Chart(int width,
int height)
width - The width of the chart in pixels.height - The height of the chart in pixels.protected Chart(int width,
int height,
int charts)
width - The width of the chart in pixels.height - The height of the chart in pixels.charts - The number of charts to display.protected void draw(Graphics2D g)
protected Rectangle draw(ChartGraphics g)
protected void calc(Graphics2D g)
protected Rectangle adjustRectangle(Graphics2D g, Rectangle rect)
protected void calcRanges()
protected int calcVariableHeight()
protected int calcVariableWidth()
protected int getXLabelWidth()
graph - The java.awt.Graphics context to draw into.protected int getXLegendHeight()
protected abstract int getYLabelWidth(Graphics2D g)
graph - The ChartGraphics context to draw into.protected abstract String[] getXLabels()
protected int getXLabelHeight()
protected abstract Rectangle getInteriorRectangle(ChartGraphics g)
protected int getExteriorHeight()
protected Collection<DataPointCollection> initData(Collection<DataPointCollection> coll)
protected void initFonts()
protected void postInit(Graphics2D g)
protected Point getDataPoint(int valuePixels, int unitPixels, int datapoint, DataPointCollection coll)
valuePixels - An int that specifies the size of the value axis in pixels.unitPixels - An int that specifies the size of the unit axis in pixels.datapoint - An int that specifies the zero-based index of the datum to calculate coordinates for.collection - The DataPointCollection the datapoint is located in.Rectangleprotected Point getDisplayPoint(int valuePixels, int unitPixels, int unitPoints, double value, int unitIndex)
valuePixels - An int that specifies the size of the value axis in pixels.unitPixels - An int that specifies the size of the unit axis in pixels.unitPoints - Number of ticks on the unit axis.value - A double that specifies the value to get coordinates for.unitIndex - Ticks on the unit axis to get coordinates for.protected String getUnitLabel(IDisplayDataPoint data)
protected boolean hasData()
protected double scale(int height)
height - The height of the rectangle to calculate the vertical scale for.protected Class<DataPointCollection> getDataCollectionClass()
protected boolean checkHighLow()
public double getAverageValue()
public String getNoDataString()
public void setNoDataString(String s)
public DataPointCollection getDataPoints()
net.hyperic.chart.DataPointCollectionpublic DataPointCollection getDataPoints(int index)
public int getDataSetCount()
public Iterator<DataPointCollection> getDataSetIterator()
public void setNumberDataSets(int number)
public void setFormat(org.rhq.core.domain.measurement.MeasurementUnits units)
public Rectangle getExteriorRectangle()
public double getLowValue()
public double getPeakValue()
public String getTitle()
public void setTitle(String title)
title - A string containing the chart's title.public String getUnitLegend()
public void setUnitLegend(String legend)
label - A java.lang.String object that contains the chart's Unit axis legend.IllegalArgumentException - If the legend parameter is null.public String getValueLegend()
public void setValueLegend(String legend)
label - A java.lang.String object that contains the chart's Value axis legend.IllegalArgumentException - If the legend parameter is null.Copyright © 2008-2013 Red Hat, Inc.. All Rights Reserved.