本文整理汇总了Java中org.jfree.data.KeyToGroupMap.getGroupIndex方法的典型用法代码示例。如果您正苦于以下问题:Java KeyToGroupMap.getGroupIndex方法的具体用法?Java KeyToGroupMap.getGroupIndex怎么用?Java KeyToGroupMap.getGroupIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.data.KeyToGroupMap
的用法示例。
在下文中一共展示了KeyToGroupMap.getGroupIndex方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findStackedRangeExtent
import org.jfree.data.KeyToGroupMap; //导入方法依赖的package包/类
/**
* Returns the minimum and maximum values for the dataset's range (as in domain/range),
* assuming that the series in one category are stacked.
*
* @param dataset the dataset.
* @param map a structure that maps series to groups.
*
* @return the value range.
*/
public static Range findStackedRangeExtent(CategoryDataset dataset,
KeyToGroupMap map) {
Range result = null;
if (dataset != null) {
// create an array holding the group indices...
int[] groupIndex = new int[dataset.getRowCount()];
for (int i = 0; i < dataset.getRowCount(); i++) {
groupIndex[i] = map.getGroupIndex(map.getGroup(dataset.getRowKey(i)));
}
// minimum and maximum for each group...
int groupCount = map.getGroupCount();
double[] minimum = new double[groupCount];
double[] maximum = new double[groupCount];
int categoryCount = dataset.getColumnCount();
for (int item = 0; item < categoryCount; item++) {
double[] positive = new double[groupCount];
double[] negative = new double[groupCount];
int seriesCount = dataset.getRowCount();
for (int series = 0; series < seriesCount; series++) {
Number number = dataset.getValue(series, item);
if (number != null) {
double value = number.doubleValue();
if (value > 0.0) {
positive[groupIndex[series]] = positive[groupIndex[series]] + value;
}
if (value < 0.0) {
negative[groupIndex[series]] = negative[groupIndex[series]] + value;
// '+', remember value is negative
}
}
}
for (int g = 0; g < groupCount; g++) {
minimum[g] = Math.min(minimum[g], negative[g]);
maximum[g] = Math.max(maximum[g], positive[g]);
}
}
for (int j = 0; j < groupCount; j++) {
result = Range.combine(result, new Range(minimum[j], maximum[j]));
}
}
return result;
}
示例2: findStackedRangeBounds
import org.jfree.data.KeyToGroupMap; //导入方法依赖的package包/类
/**
* Returns the minimum and maximum values for the dataset's range
* (y-values), assuming that the series in one category are stacked.
*
* @param dataset the dataset.
* @param map a structure that maps series to groups.
*
* @return The value range (<code>null</code> if the dataset contains no
* values).
*/
public static Range findStackedRangeBounds(CategoryDataset dataset,
KeyToGroupMap map) {
Range result = null;
if (dataset != null) {
// create an array holding the group indices...
int[] groupIndex = new int[dataset.getRowCount()];
for (int i = 0; i < dataset.getRowCount(); i++) {
groupIndex[i] = map.getGroupIndex(
map.getGroup(dataset.getRowKey(i))
);
}
// minimum and maximum for each group...
int groupCount = map.getGroupCount();
double[] minimum = new double[groupCount];
double[] maximum = new double[groupCount];
int categoryCount = dataset.getColumnCount();
for (int item = 0; item < categoryCount; item++) {
double[] positive = new double[groupCount];
double[] negative = new double[groupCount];
int seriesCount = dataset.getRowCount();
for (int series = 0; series < seriesCount; series++) {
Number number = dataset.getValue(series, item);
if (number != null) {
double value = number.doubleValue();
if (value > 0.0) {
positive[groupIndex[series]]
= positive[groupIndex[series]] + value;
}
if (value < 0.0) {
negative[groupIndex[series]]
= negative[groupIndex[series]] + value;
// '+', remember value is negative
}
}
}
for (int g = 0; g < groupCount; g++) {
minimum[g] = Math.min(minimum[g], negative[g]);
maximum[g] = Math.max(maximum[g], positive[g]);
}
}
for (int j = 0; j < groupCount; j++) {
result = Range.combine(
result, new Range(minimum[j], maximum[j])
);
}
}
return result;
}
示例3: findStackedRangeBounds
import org.jfree.data.KeyToGroupMap; //导入方法依赖的package包/类
/**
* Returns the minimum and maximum values for the dataset's range
* (y-values), assuming that the series in one category are stacked.
*
* @param dataset the dataset.
* @param map a structure that maps series to groups.
*
* @return The value range (<code>null</code> if the dataset contains no
* values).
*/
public static Range findStackedRangeBounds(CategoryDataset dataset,
KeyToGroupMap map) {
ParamChecks.nullNotPermitted(dataset, "dataset");
boolean hasValidData = false;
Range result = null;
// create an array holding the group indices for each series...
int[] groupIndex = new int[dataset.getRowCount()];
for (int i = 0; i < dataset.getRowCount(); i++) {
groupIndex[i] = map.getGroupIndex(map.getGroup(
dataset.getRowKey(i)));
}
// minimum and maximum for each group...
int groupCount = map.getGroupCount();
double[] minimum = new double[groupCount];
double[] maximum = new double[groupCount];
int categoryCount = dataset.getColumnCount();
for (int item = 0; item < categoryCount; item++) {
double[] positive = new double[groupCount];
double[] negative = new double[groupCount];
int seriesCount = dataset.getRowCount();
for (int series = 0; series < seriesCount; series++) {
Number number = dataset.getValue(series, item);
if (number != null) {
hasValidData = true;
double value = number.doubleValue();
if (value > 0.0) {
positive[groupIndex[series]]
= positive[groupIndex[series]] + value;
}
if (value < 0.0) {
negative[groupIndex[series]]
= negative[groupIndex[series]] + value;
// '+', remember value is negative
}
}
}
for (int g = 0; g < groupCount; g++) {
minimum[g] = Math.min(minimum[g], negative[g]);
maximum[g] = Math.max(maximum[g], positive[g]);
}
}
if (hasValidData) {
for (int j = 0; j < groupCount; j++) {
result = Range.combine(result, new Range(minimum[j],
maximum[j]));
}
}
return result;
}
示例4: findStackedRangeBounds
import org.jfree.data.KeyToGroupMap; //导入方法依赖的package包/类
/**
* Returns the minimum and maximum values for the dataset's range
* (y-values), assuming that the series in one category are stacked.
*
* @param dataset the dataset.
* @param map a structure that maps series to groups.
*
* @return The value range ({@code null} if the dataset contains no
* values).
*/
public static Range findStackedRangeBounds(CategoryDataset dataset,
KeyToGroupMap map) {
Args.nullNotPermitted(dataset, "dataset");
boolean hasValidData = false;
Range result = null;
// create an array holding the group indices for each series...
int[] groupIndex = new int[dataset.getRowCount()];
for (int i = 0; i < dataset.getRowCount(); i++) {
groupIndex[i] = map.getGroupIndex(map.getGroup(
dataset.getRowKey(i)));
}
// minimum and maximum for each group...
int groupCount = map.getGroupCount();
double[] minimum = new double[groupCount];
double[] maximum = new double[groupCount];
int categoryCount = dataset.getColumnCount();
for (int item = 0; item < categoryCount; item++) {
double[] positive = new double[groupCount];
double[] negative = new double[groupCount];
int seriesCount = dataset.getRowCount();
for (int series = 0; series < seriesCount; series++) {
Number number = dataset.getValue(series, item);
if (number != null) {
hasValidData = true;
double value = number.doubleValue();
if (value > 0.0) {
positive[groupIndex[series]]
= positive[groupIndex[series]] + value;
}
if (value < 0.0) {
negative[groupIndex[series]]
= negative[groupIndex[series]] + value;
// '+', remember value is negative
}
}
}
for (int g = 0; g < groupCount; g++) {
minimum[g] = Math.min(minimum[g], negative[g]);
maximum[g] = Math.max(maximum[g], positive[g]);
}
}
if (hasValidData) {
for (int j = 0; j < groupCount; j++) {
result = Range.combine(result, new Range(minimum[j],
maximum[j]));
}
}
return result;
}
示例5: findStackedRangeBounds
import org.jfree.data.KeyToGroupMap; //导入方法依赖的package包/类
/**
* Returns the minimum and maximum values for the dataset's range
* (y-values), assuming that the series in one category are stacked.
*
* @param dataset the dataset.
* @param map a structure that maps series to groups.
*
* @return The value range (<code>null</code> if the dataset contains no
* values).
*/
public static Range findStackedRangeBounds(CategoryDataset dataset,
KeyToGroupMap map) {
Range result = null;
if (dataset != null) {
// create an array holding the group indices...
int[] groupIndex = new int[dataset.getRowCount()];
for (int i = 0; i < dataset.getRowCount(); i++) {
groupIndex[i] = map.getGroupIndex(
map.getGroup(dataset.getRowKey(i))
);
}
// minimum and maximum for each group...
int groupCount = map.getGroupCount();
double[] minimum = new double[groupCount];
double[] maximum = new double[groupCount];
int categoryCount = dataset.getColumnCount();
for (int item = 0; item < categoryCount; item++) {
double[] positive = new double[groupCount];
double[] negative = new double[groupCount];
int seriesCount = dataset.getRowCount();
for (int series = 0; series < seriesCount; series++) {
Number number = dataset.getValue(series, item);
if (number != null) {
double value = number.doubleValue();
if (value > 0.0) {
positive[groupIndex[series]]
= positive[groupIndex[series]] + value;
}
if (value < 0.0) {
negative[groupIndex[series]]
= negative[groupIndex[series]] + value;
// '+', remember value is negative
}
}
}
for (int g = 0; g < groupCount; g++) {
minimum[g] = Math.min(minimum[g], negative[g]);
maximum[g] = Math.max(maximum[g], positive[g]);
}
}
for (int j = 0; j < groupCount; j++) {
result = Range.combine(
result, new Range(minimum[j], maximum[j])
);
}
}
return result;
}
示例6: findStackedRangeBounds
import org.jfree.data.KeyToGroupMap; //导入方法依赖的package包/类
/**
* Returns the minimum and maximum values for the dataset's range
* (y-values), assuming that the series in one category are stacked.
*
* @param dataset the dataset.
* @param map a structure that maps series to groups.
*
* @return The value range (<code>null</code> if the dataset contains no
* values).
*/
public static Range findStackedRangeBounds(CategoryDataset dataset,
KeyToGroupMap map) {
if (dataset == null) {
throw new IllegalArgumentException("Null 'dataset' argument.");
}
boolean hasValidData = false;
Range result = null;
// create an array holding the group indices for each series...
int[] groupIndex = new int[dataset.getRowCount()];
for (int i = 0; i < dataset.getRowCount(); i++) {
groupIndex[i] = map.getGroupIndex(map.getGroup(
dataset.getRowKey(i)));
}
// minimum and maximum for each group...
int groupCount = map.getGroupCount();
double[] minimum = new double[groupCount];
double[] maximum = new double[groupCount];
int categoryCount = dataset.getColumnCount();
for (int item = 0; item < categoryCount; item++) {
double[] positive = new double[groupCount];
double[] negative = new double[groupCount];
int seriesCount = dataset.getRowCount();
for (int series = 0; series < seriesCount; series++) {
Number number = dataset.getValue(series, item);
if (number != null) {
hasValidData = true;
double value = number.doubleValue();
if (value > 0.0) {
positive[groupIndex[series]]
= positive[groupIndex[series]] + value;
}
if (value < 0.0) {
negative[groupIndex[series]]
= negative[groupIndex[series]] + value;
// '+', remember value is negative
}
}
}
for (int g = 0; g < groupCount; g++) {
minimum[g] = Math.min(minimum[g], negative[g]);
maximum[g] = Math.max(maximum[g], positive[g]);
}
}
if (hasValidData) {
for (int j = 0; j < groupCount; j++) {
result = Range.combine(result, new Range(minimum[j],
maximum[j]));
}
}
return result;
}