public class ChartScale extends Object
Modifier and Type | Field and Description |
---|---|
(package private) int |
rounding
The suggested value for the rounding of the data.
|
(package private) int |
segments
The number of segments that the suggested yStart, yEnd and yDelta produce.
|
(package private) double |
yDelta
The difference between two points on adjacent grid lines.
|
(package private) double |
yEnd
The value which the last grid line represents.
|
(package private) double |
yMax
The largest number in the dataset.
|
(package private) double |
yMin
The smallest number in the dataset.
|
(package private) double |
yStart
The value which the first grid line represents.
|
Constructor and Description |
---|
ChartScale() |
ChartScale(double[][] data)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private void |
calculate()
Compute yDelta, yStart, yEnd, segments and rounding.
|
AxisProperties |
getAxisProperties()
Creates and returns a new AxisProperties object based on the internally calculated values of yStart, yDelta,
segments and rounding.
|
private double |
getMax(double[][] data)
Helper method that finds the largest double in the 2D array of doubles.
|
private double |
getMin(double[][] data)
Helper method that finds the smallest double in the 2D array of doubles.
|
int |
getRounding()
Accessor for the rounding property.
|
int |
getSegments()
Accessor for the segments property.
|
double |
getYDelta()
Accessor for the yDelta property.
|
double |
getYEnd()
Accessor for the yEnd property.
|
double |
getYMax()
Accessor for the yMax property.
|
double |
getYMin()
Accessor for the yMin property.
|
double |
getYStart()
Accessor for the yStart property.
|
static void |
main(String[] args) |
double yMax
double yMin
double yDelta
double yStart
double yEnd
int rounding
int segments
public ChartScale()
public ChartScale(double[][] data)
data
- double[] the data for which you would like suggested graph valuespublic static void main(String[] args)
private void calculate()
private double getMax(double[][] data)
data
- double[][] to look into for the maxprivate double getMin(double[][] data)
data
- double[][] to look into for the minpublic double getYMax()
public double getYMin()
public double getYDelta()
public double getYStart()
public double getYEnd()
public int getRounding()
public int getSegments()
public AxisProperties getAxisProperties() throws PropertyException
PropertyException