|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ijchart.xychart.util.DatasetUtil
public abstract class DatasetUtil
Title: IJChart
Description: a chart library for the Java(tm) platform.
A util class for dataset.Copyright: Copyright (c) 2013
Company:
Constructor Summary | |
---|---|
DatasetUtil()
|
Method Summary | |
---|---|
static double |
calculateDatasetTotalForPieChart(SingleRowDataset dataset)
Calculates the total of all the values in a SingleRowDataset .If
the dataset contains negative or null values, they are ignored. |
static XYNumberChartData[] |
calculateDateMovingAverageDatas(java.util.List xyNumberData,
int skipDays,
int averageLen)
Calculate the month moving average datas. |
static XYNumberChartData[] |
calculateMovingAverageDatas(java.util.List xyNumberData,
int skip,
int averageLen)
Calculate moving average datas. |
static IntervalXYNumberChartData[] |
convertToHistogramData(double[] values,
int bins,
double minimum,
double maximum,
HistogramType type)
Calculate histogram datas. |
static IntervalXYNumberChartData[] |
convertToHistogramData(double[] values,
int bins,
HistogramType type)
Calculate histogram datas. |
static IMatrixDataset |
convertToHistogramDataset(IMatrixDataset dataset,
int bins,
double minimum,
double maximum,
HistogramType type)
Convert a number dataset to histogram datasete. |
static IMatrixDataset |
convertToHistogramDataset(IMatrixDataset dataset,
int bins,
HistogramType type)
Convert a number dataset to histogram datasete. |
static IMatrixDataset |
createMovingAverageOHLCDataset(IMatrixDataset sourceDataset,
java.lang.String rowKeyPrefix,
java.lang.String rowKeySuffix,
int averageLen)
Creates a new IMatrixDataset containing the moving averages of each series in the
source dataset,and each data is
OHLCChartData object in source dataset, |
static int[] |
findDataPosition(IMatrixDataset dataset,
IChartData data)
Find the position for specified data. |
static IChartData[] |
findMinAndMaxChartData(IMatrixDataset dataset)
Find the minimum and maximum data of the dataset. |
static XYNumberChartData[] |
getDatasByFunction(IFunction function,
double start,
double end,
int samples)
Calculate chart datas by a function. |
static NumberRange |
getDatasetYRangeForStackBarRender(IMatrixDataset dataset)
Calculate the range of y value,this dataset used for XYStackedBarRender . |
static IChartData[] |
getMinAndMaxValue(IMatrixDataset dataset,
java.util.Comparator comp)
Calculate the minimum and maximum value of dataset. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DatasetUtil()
Method Detail |
---|
public static NumberRange getDatasetYRangeForStackBarRender(IMatrixDataset dataset)
XYStackedBarRender
.
dataset
- IMatrixDataset
The dataset,each data is NumberChartData
object in dataset.
public static IChartData[] getMinAndMaxValue(IMatrixDataset dataset, java.util.Comparator comp)
dataset
- IMatrixDataset
The dataset.comp
- Comparator
The comparator with which to determine the minimum element.A null value indicates that
the elements' natural ordering should be used (null permitted).
public static IMatrixDataset createMovingAverageOHLCDataset(IMatrixDataset sourceDataset, java.lang.String rowKeyPrefix, java.lang.String rowKeySuffix, int averageLen)
IMatrixDataset
containing the moving averages of each series in the
source dataset,and each data is
OHLCChartData
object in source dataset,
sourceDataset
- IMatrixDataset
The source dataset (null permitted).rowKeyPrefix
- String
The string to added in front of thesource rowKey to create new rowKey
names (null permitted).rowKeySuffix
- String
The string to append to source rowKey to create new rowKey names (null permitted).averageLen
- int
The length of average datas.
DateNumberChartData
object
in new dataset.public static IChartData[] findMinAndMaxChartData(IMatrixDataset dataset)
dataset
- IMatrixDataset
The dataset (null not permitted).
public static double calculateDatasetTotalForPieChart(SingleRowDataset dataset)
SingleRowDataset
.If
the dataset contains negative or null values, they are ignored.
dataset
- SingleRowDataset
The dataset (null not permitted).
public static IMatrixDataset convertToHistogramDataset(IMatrixDataset dataset, int bins, HistogramType type)
dataset
- IMatrixDataset
A dataset,each data is NumberChartData
object in dataset. (null not permitted).bins
- int
The number of bins,must be greater than 0.type
- HistogramType
The histogram type (null not permitted).
public static IMatrixDataset convertToHistogramDataset(IMatrixDataset dataset, int bins, double minimum, double maximum, HistogramType type)
dataset
- IMatrixDataset
A dataset,each data is NumberChartData
object in dataset. (null not permitted).bins
- int
The number of bins,must be greater than 0.minimum
- double
The lower bound of the bin range.maximum
- double
The upper bound of the bin range.type
- HistogramType
The histogram type (null not permitted).
public static IntervalXYNumberChartData[] convertToHistogramData(double[] values, int bins, HistogramType type)
values
- double[]
The values.bins
- int
The number of bins,must be greater than 0.type
- HistogramType
The histogram type (null not permitted).
public static IntervalXYNumberChartData[] convertToHistogramData(double[] values, int bins, double minimum, double maximum, HistogramType type)
values
- double[]
The values.bins
- int
The number of bins,must be greater than 0.minimum
- double
The lower bound of the bin range.maximum
- double
The upper bound of the bin range.type
- HistogramType
The histogram type (null not permitted).
public static XYNumberChartData[] getDatasByFunction(IFunction function, double start, double end, int samples)
function
- IFunction
The function (null not permitted).start
- double
The start value for the range.end
- double
The end value for the range.samples
- int
The number of sample points.
public static XYNumberChartData[] calculateMovingAverageDatas(java.util.List xyNumberData, int skip, int averageLen)
xyNumberData
- List
The list of XYNumberChartData
data (null not permitted).skip
- int
The number of datas to skip.averageLen
- int
The length of average datas.
public static XYNumberChartData[] calculateDateMovingAverageDatas(java.util.List xyNumberData, int skipDays, int averageLen)
xyNumberData
- List
The list of XYNumberChartData
data (null not permitted).skipDays
- int
The number of days to skip.averageLen
- int
The length of average datas.
public static int[] findDataPosition(IMatrixDataset dataset, IChartData data)
dataset
- IMatrixDataset
The dataset,each data is NumberChartData
object in dataset.data
- IChartData
The specified data object (null permitted).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |