|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.corpstein.image.ChartMetrics
public class ChartMetrics
Encapsulates the various metrics used to create chart images using
ChartFactory
.
Constructor Summary | |
---|---|
ChartMetrics(ChartData data,
ChartStyle style)
Sole constructor |
Method Summary | |
---|---|
int |
get(int index)
Returns the named metric |
int |
getCoordinate(int array,
int index)
Returns the coordinate for the named array and the specified index |
int |
getMaxLabelWidth(ChartData data,
ChartStyle style)
Returns the maximum width allowed for a label given the specified ChartData and ChartStyle |
double |
getPixelInterval()
Return the number of pixels of bar/line height that equate to one data unit for a given chart. |
int |
getTotalCoordinates(int array)
Returns the total coordinates stored in the given array |
void |
initializeMetrics(ChartData data)
Initializes the metrics based on the maximum value stored in the ChartData object. |
void |
prepareMetrics(ChartData data)
Adjusts the metrics based on the maximum value stored in the ChartData object. |
void |
set(int index,
int value)
Sets the named metric |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int METRIC_BASE_BAR_OFFSET
public static final int METRIC_BAR_INTERVAL
public static final int METRIC_BAR_WIDTH
public static final int METRIC_KEY_WIDTH
public static final int METRIC_KEY_OFFSET_X
public static final int METRIC_KEY_OFFSET_Y
public static final int METRIC_KEY_COLUMNS
public static final int METRIC_KEY_ROWS
public static final int METRIC_MAX_LABEL_WIDTH
public static final int METRIC_LABEL_DIAGONAL
public static final int METRIC_DIAGONAL_X
public static final int METRIC_DIAGONAL_Y
public static final int METRIC_DEPTH_OFFSET
public static final int METRIC_BAR_DEPTH
public static final int METRIC_LABEL_INTERVAL
public static final int METRIC_LABEL_SIGNIFICANT_FIGURES
public static final int METRIC_Y_AXIS_LABELS
public static final int METRIC_TITLE_Y
public static final int METRIC_TITLE_SHADOW_Y
public static final int METRIC_HORIZONTAL_KEY_OFFSET_X
public static final int COORD_BACKDROP_X
public static final int COORD_BACKDROP_Y
public static final int KEY_HEIGHT
public static final int HORIZONTAL_KEY_OFFSET_Y
public static final int DIAGONAL_KEY_MAX_LABEL_WIDTH
public static final int DIAGONAL_KEY_LINE_CHART_MAX_LABEL_WIDTH
public static final int BACKDROP_PLACEMENT_X
public static final int BACKDROP_PLACEMENT_Y
public static final int BACKDROP_WIDTH
public static final int BACKDROP_HEIGHT
public static final int PIE_DEPTH
public static final float PIE_ROTATION_ANGLE
public static final int Z_INDEX_BACKGROUND
public static final int Z_INDEX_BORDER
public static final int Z_INDEX_BACKDROP
public static final int Z_INDEX_SCALE
public static final int Z_INDEX_BARS
public static final int Z_INDEX_SLICES
public static final int Z_INDEX_LINES
public static final int Z_INDEX_AXIS_LABEL
public static final int Z_INDEX_KEY
public static final int Z_INDEX_TITLE
public static final int MIN_Z_INDEX
public static final int MAX_Z_INDEX
Constructor Detail |
---|
public ChartMetrics(ChartData data, ChartStyle style)
data
- The ChartData object containing the data points that will
affect the metricsstyle
- The ChartStyle object containing the chart type, key type,
and other parameters that determine the metricsMethod Detail |
---|
public int get(int index)
index
- The metric to return
java.lang.IllegalArgumentException
- if the index is out of boundspublic int getCoordinate(int array, int index)
array
- The array (COORD_BACKDROP_X or COORD_BACKDROP_Y)index
- The index into the array of the coordinate we are looking
for
java.lang.IllegalArgumentException
- If the array is invalid or the index
is out of boundspublic int getMaxLabelWidth(ChartData data, ChartStyle style)
data
- The ChartData object used to determine the total columns
and total values per column, given the CharStyle chart type and key
typestyle
- The ChartStyle object used to determine the key type,
chart type
public double getPixelInterval()
public int getTotalCoordinates(int array)
array
- The array to measure
java.lang.IllegalArgumentException
- if the specified array does not existpublic void initializeMetrics(ChartData data)
public void prepareMetrics(ChartData data)
public void set(int index, int value)
index
- The metric to setvalue
- The value to set the metric to
java.lang.IllegalArgumentException
- if the index is out of bounds
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |