本文整理汇总了Java中org.jfree.data.xy.XYZDataset.getXValue方法的典型用法代码示例。如果您正苦于以下问题:Java XYZDataset.getXValue方法的具体用法?Java XYZDataset.getXValue怎么用?Java XYZDataset.getXValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.data.xy.XYZDataset
的用法示例。
在下文中一共展示了XYZDataset.getXValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: iterateToFindZBounds
import org.jfree.data.xy.XYZDataset; //导入方法依赖的package包/类
/**
* Returns the range of z-values in the specified dataset for the
* data items belonging to the visible series and with x-values in the
* given range.
*
* @param dataset the dataset (<code>null</code> not permitted).
* @param visibleSeriesKeys the visible series keys (<code>null</code> not
* permitted).
* @param xRange the x-range (<code>null</code> not permitted).
* @param includeInterval a flag that determines whether or not the
* z-interval for the dataset is included (this only applies if the
* dataset has an interval, which is currently not supported).
*
* @return The y-range (possibly <code>null</code>).
*/
public static Range iterateToFindZBounds(XYZDataset dataset,
List visibleSeriesKeys, Range xRange, boolean includeInterval) {
ParamChecks.nullNotPermitted(dataset, "dataset");
ParamChecks.nullNotPermitted(visibleSeriesKeys, "visibleSeriesKeys");
ParamChecks.nullNotPermitted(xRange, "xRange");
double minimum = Double.POSITIVE_INFINITY;
double maximum = Double.NEGATIVE_INFINITY;
Iterator iterator = visibleSeriesKeys.iterator();
while (iterator.hasNext()) {
Comparable seriesKey = (Comparable) iterator.next();
int series = dataset.indexOf(seriesKey);
int itemCount = dataset.getItemCount(series);
for (int item = 0; item < itemCount; item++) {
double x = dataset.getXValue(series, item);
double z = dataset.getZValue(series, item);
if (xRange.contains(x)) {
if (!Double.isNaN(z)) {
minimum = Math.min(minimum, z);
maximum = Math.max(maximum, z);
}
}
}
}
if (minimum == Double.POSITIVE_INFINITY) {
return null;
}
else {
return new Range(minimum, maximum);
}
}
示例2: iterateToFindZBounds
import org.jfree.data.xy.XYZDataset; //导入方法依赖的package包/类
/**
* Returns the range of z-values in the specified dataset for the
* data items belonging to the visible series and with x-values in the
* given range.
*
* @param dataset the dataset ({@code null} not permitted).
* @param visibleSeriesKeys the visible series keys ({@code null} not
* permitted).
* @param xRange the x-range ({@code null} not permitted).
* @param includeInterval a flag that determines whether or not the
* z-interval for the dataset is included (this only applies if the
* dataset has an interval, which is currently not supported).
*
* @return The y-range (possibly {@code null}).
*/
public static Range iterateToFindZBounds(XYZDataset dataset,
List visibleSeriesKeys, Range xRange, boolean includeInterval) {
Args.nullNotPermitted(dataset, "dataset");
Args.nullNotPermitted(visibleSeriesKeys, "visibleSeriesKeys");
Args.nullNotPermitted(xRange, "xRange");
double minimum = Double.POSITIVE_INFINITY;
double maximum = Double.NEGATIVE_INFINITY;
Iterator iterator = visibleSeriesKeys.iterator();
while (iterator.hasNext()) {
Comparable seriesKey = (Comparable) iterator.next();
int series = dataset.indexOf(seriesKey);
int itemCount = dataset.getItemCount(series);
for (int item = 0; item < itemCount; item++) {
double x = dataset.getXValue(series, item);
double z = dataset.getZValue(series, item);
if (xRange.contains(x)) {
if (!Double.isNaN(z)) {
minimum = Math.min(minimum, z);
maximum = Math.max(maximum, z);
}
}
}
}
if (minimum == Double.POSITIVE_INFINITY) {
return null;
} else {
return new Range(minimum, maximum);
}
}
示例3: Summary
import org.jfree.data.xy.XYZDataset; //导入方法依赖的package包/类
/**
* calculate the statistical summary for the given dataset
* @param dataset
*/
public Summary(XYZDataset dataset){
seriesCount = dataset.getSeriesCount();
sampleSize = new int[seriesCount];
mean = new double[seriesCount];
median = new double[seriesCount];
stdDev = new double[seriesCount];
skew = new double[seriesCount];
kurt = new double[seriesCount];
seriesName = new String[seriesCount];
int count = 0;
for (int i=0; i<seriesCount; i++){
int rowCount = dataset.getItemCount(i);
seriesName[i] = dataset.getSeriesKey(i).toString();
Double[] values = new Double[rowCount];
List<Double> valueList = new java.util.ArrayList<Double>();
for (int j=0; j<rowCount; j++){
double v = dataset.getXValue(i,j);
if (!Double.isNaN(v)){
values[count]=new Double(v);
valueList.add(new Double(v));
count++;
}
}
sampleSize[i]= valueList.size();
mean[i] = Statistics.calculateMean(values, false);
median[i] = Statistics.calculateMedian(valueList);
stdDev[i] = Statistics.getStdDev(values);
skew[i] = Statistics.calculateSkewness(values);
kurt[i] = Statistics.calculateKurtosis(values);
}
return;
}