本文整理汇总了Java中org.jfree.data.statistics.BoxAndWhiskerCategoryDataset类的典型用法代码示例。如果您正苦于以下问题:Java BoxAndWhiskerCategoryDataset类的具体用法?Java BoxAndWhiskerCategoryDataset怎么用?Java BoxAndWhiskerCategoryDataset使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BoxAndWhiskerCategoryDataset类属于org.jfree.data.statistics包,在下文中一共展示了BoxAndWhiskerCategoryDataset类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createItemArray
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
* Creates the array of items that can be passed to the {@link MessageFormat} class
* for creating labels.
*
* @param dataset the dataset (<code>null</code> not permitted).
* @param series the series (zero-based index).
* @param item the item (zero-based index).
*
* @return the items (never <code>null</code>).
*/
protected Object[] createItemArray(CategoryDataset dataset, int series, int item) {
Object[] result = new Object[8];
result[0] = dataset.getRowKey(series);
Number y = dataset.getValue(series, item);
NumberFormat formatter = getNumberFormat();
result[1] = formatter.format(y);
if (dataset instanceof BoxAndWhiskerCategoryDataset) {
BoxAndWhiskerCategoryDataset d = (BoxAndWhiskerCategoryDataset) dataset;
result[2] = formatter.format(d.getMeanValue(series, item));
result[3] = formatter.format(d.getMedianValue(series, item));
result[4] = formatter.format(d.getMinRegularValue(series, item));
result[5] = formatter.format(d.getMaxRegularValue(series, item));
result[6] = formatter.format(d.getQ1Value(series, item));
result[7] = formatter.format(d.getQ3Value(series, item));
}
return result;
}
示例2: createBoxAndWhiskerChart
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
* Creates and returns a default instance of a box and whisker chart
* based on data from a {@link BoxAndWhiskerCategoryDataset}.
*
* @param title the chart title (<code>null</code> permitted).
* @param categoryAxisLabel a label for the category axis
* (<code>null</code> permitted).
* @param valueAxisLabel a label for the value axis (<code>null</code>
* permitted).
* @param dataset the dataset for the chart (<code>null</code> permitted).
* @param legend a flag specifying whether or not a legend is required.
*
* @return A box and whisker chart.
*
* @since 1.0.4
*/
public static JFreeChart createBoxAndWhiskerChart(String title,
String categoryAxisLabel, String valueAxisLabel,
BoxAndWhiskerCategoryDataset dataset, boolean legend) {
CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
valueAxis.setAutoRangeIncludesZero(false);
BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
renderer.setToolTipGenerator(new BoxAndWhiskerToolTipGenerator());
CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
renderer);
return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot,
legend);
}
示例3: createItemArray
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
* Creates the array of items that can be passed to the
* {@link MessageFormat} class for creating labels.
*
* @param dataset the dataset (<code>null</code> not permitted).
* @param series the series (zero-based index).
* @param item the item (zero-based index).
*
* @return The items (never <code>null</code>).
*/
protected Object[] createItemArray(CategoryDataset dataset, int series,
int item) {
Object[] result = new Object[8];
result[0] = dataset.getRowKey(series);
Number y = dataset.getValue(series, item);
NumberFormat formatter = getNumberFormat();
result[1] = formatter.format(y);
if (dataset instanceof BoxAndWhiskerCategoryDataset) {
BoxAndWhiskerCategoryDataset d
= (BoxAndWhiskerCategoryDataset) dataset;
result[2] = formatter.format(d.getMeanValue(series, item));
result[3] = formatter.format(d.getMedianValue(series, item));
result[4] = formatter.format(d.getMinRegularValue(series, item));
result[5] = formatter.format(d.getMaxRegularValue(series, item));
result[6] = formatter.format(d.getQ1Value(series, item));
result[7] = formatter.format(d.getQ3Value(series, item));
}
return result;
}
示例4: createBoxAndWhiskerChart
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
* Creates and returns a default instance of a box and whisker chart
* based on data from a {@link BoxAndWhiskerCategoryDataset}.
*
* @param title the chart title (<code>null</code> permitted).
* @param categoryAxisLabel a label for the category axis
* (<code>null</code> permitted).
* @param valueAxisLabel a label for the value axis (<code>null</code>
* permitted).
* @param dataset the dataset for the chart (<code>null</code> permitted).
* @param legend a flag specifying whether or not a legend is required.
*
* @return A box and whisker chart.
*
* @since 1.0.4
*/
public static JFreeChart createBoxAndWhiskerChart(String title,
String categoryAxisLabel, String valueAxisLabel,
BoxAndWhiskerCategoryDataset dataset, boolean legend) {
CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
valueAxis.setAutoRangeIncludesZero(false);
BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
renderer.setBaseToolTipGenerator(new BoxAndWhiskerToolTipGenerator());
CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
renderer);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
currentTheme.apply(chart);
return chart;
}
示例5: createItemArray
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
* Creates the array of items that can be passed to the
* {@link MessageFormat} class for creating labels.
*
* @param dataset the dataset (<code>null</code> not permitted).
* @param series the series (zero-based index).
* @param item the item (zero-based index).
*
* @return The items (never <code>null</code>).
*/
@Override
protected Object[] createItemArray(CategoryDataset dataset, int series,
int item) {
Object[] result = new Object[8];
result[0] = dataset.getRowKey(series);
Number y = dataset.getValue(series, item);
NumberFormat formatter = getNumberFormat();
result[1] = formatter.format(y);
if (dataset instanceof BoxAndWhiskerCategoryDataset) {
BoxAndWhiskerCategoryDataset d
= (BoxAndWhiskerCategoryDataset) dataset;
result[2] = formatter.format(d.getMeanValue(series, item));
result[3] = formatter.format(d.getMedianValue(series, item));
result[4] = formatter.format(d.getMinRegularValue(series, item));
result[5] = formatter.format(d.getMaxRegularValue(series, item));
result[6] = formatter.format(d.getQ1Value(series, item));
result[7] = formatter.format(d.getQ3Value(series, item));
}
return result;
}
示例6: createBoxAndWhiskerChart
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
* Creates and returns a default instance of a box and whisker chart
* based on data from a {@link BoxAndWhiskerCategoryDataset}.
*
* @param title the chart title ({@code null} permitted).
* @param categoryAxisLabel a label for the category axis
* ({@code null} permitted).
* @param valueAxisLabel a label for the value axis ({@code null}
* permitted).
* @param dataset the dataset for the chart ({@code null} permitted).
* @param legend a flag specifying whether or not a legend is required.
*
* @return A box and whisker chart.
*
* @since 1.0.4
*/
public static JFreeChart createBoxAndWhiskerChart(String title,
String categoryAxisLabel, String valueAxisLabel,
BoxAndWhiskerCategoryDataset dataset, boolean legend) {
CategoryAxis categoryAxis = new CategoryAxis(categoryAxisLabel);
NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
valueAxis.setAutoRangeIncludesZero(false);
BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
renderer.setDefaultToolTipGenerator(new BoxAndWhiskerToolTipGenerator());
CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis,
renderer);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
currentTheme.apply(chart);
return chart;
}
示例7: createItemArray
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
* Creates the array of items that can be passed to the
* {@link MessageFormat} class for creating labels.
*
* @param dataset the dataset ({@code null} not permitted).
* @param series the series (zero-based index).
* @param item the item (zero-based index).
*
* @return The items (never {@code null}).
*/
@Override
protected Object[] createItemArray(CategoryDataset dataset, int series,
int item) {
Object[] result = new Object[8];
result[0] = dataset.getRowKey(series);
Number y = dataset.getValue(series, item);
NumberFormat formatter = getNumberFormat();
result[1] = formatter.format(y);
if (dataset instanceof BoxAndWhiskerCategoryDataset) {
BoxAndWhiskerCategoryDataset d
= (BoxAndWhiskerCategoryDataset) dataset;
result[2] = formatter.format(d.getMeanValue(series, item));
result[3] = formatter.format(d.getMedianValue(series, item));
result[4] = formatter.format(d.getMinRegularValue(series, item));
result[5] = formatter.format(d.getMaxRegularValue(series, item));
result[6] = formatter.format(d.getQ1Value(series, item));
result[7] = formatter.format(d.getQ3Value(series, item));
}
return result;
}
示例8: createChart
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
* Creates a chart.
*
* @param dataset the dataset.
*
* @return a chart.
*/
protected JFreeChart createChart(BoxAndWhiskerCategoryDataset dataset) {
// create the chart...
CategoryAxis domainAxis = new CategoryAxis(null);
NumberAxis rangeAxis = new NumberAxis("Value");
CategoryItemRenderer renderer = new BoxAndWhiskerRenderer();
CategoryPlot plot = new CategoryPlot(
dataset, domainAxis, rangeAxis, renderer
);
JFreeChart chart = new JFreeChart(chartTitle, plot);
chart.setBackgroundPaint(Color.white);
plot.setBackgroundPaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.white);
plot.setDomainGridlinesVisible(true);
plot.setRangeGridlinePaint(Color.white);
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
return chart;
}
示例9: createBoxAndWhiskerDataset
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入依赖的package包/类
private BoxAndWhiskerCategoryDataset createBoxAndWhiskerDataset(int seriesCount, int categoryCount, String[] seriesName, String[][] categoryName, double[][][] values ){
List<Double> list;
DefaultBoxAndWhiskerCategoryDataset result
= new DefaultBoxAndWhiskerCategoryDataset();
for (int s = 0; s <seriesCount; s++) {
for (int c = 0; c <categoryCount; c++) {
list = new java.util.ArrayList<Double>();
for (int i=0; i<Array.getLength(values[s][c]);i++)
list.add(new Double(values[s][c][i]));
result.add(list, seriesName[s], categoryName[s][c]);
}
}
return result;
}
示例10: createDataset2
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入依赖的package包/类
protected BoxAndWhiskerCategoryDataset createDataset2(boolean isDemo) {
if (isDemo){
SERIES_COUNT = 1;
CATEGORY_COUNT = 1;
VALUE_COUNT = 20;
values_storage = new String[SERIES_COUNT][CATEGORY_COUNT];
DefaultBoxAndWhiskerCategoryDataset result
= new DefaultBoxAndWhiskerCategoryDataset();
List values = createValueList("3, -2, 4, 4, 5, 6, 6, 7, 1, 1, 1, 2,3, 4, 3, 4, 3, 10, 7, 6");
result.add(values, "" , "" );
values_storage[0][0]="3, -2, 4, 4, 5, 6, 6, 7, 1, 1, 1, 2,3, 4, 3, 4, 3, 10, 7, 6";
return result;}
else return super.createDataset2(false);
}
示例11: createDataset
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
* Returns a sample dataset.
*
* @return The dataset.
*/
protected BoxAndWhiskerCategoryDataset createDataset(boolean isDemo) {
if (isDemo){
SERIES_COUNT = 3;
CATEGORY_COUNT = 2;
VALUE_COUNT = 10;
values_storage = new String[SERIES_COUNT][CATEGORY_COUNT];
DefaultBoxAndWhiskerCategoryDataset result
= new DefaultBoxAndWhiskerCategoryDataset();
for (int s = 0; s < SERIES_COUNT; s++) {
for (int c = 0; c < CATEGORY_COUNT; c++) {
List values = createValueList(0, 20.0, VALUE_COUNT);
values_storage[s][c]= vs;
result.add(values, "Series " + s, "Category " + c);
}
}
return result;}
else return super.createDataset(false);
}
示例12: createDataset
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
* Returns a sample dataset.
*
* @return The dataset.
*/
protected BoxAndWhiskerCategoryDataset createDataset(boolean isDemo) {
if (isDemo){
rangeLabel = "Value";
SERIES_COUNT = 3;
// CATEGORY_COUNT = 2;
VALUE_COUNT = 10;
values_storage = new String[SERIES_COUNT][CATEGORY_COUNT];
DefaultBoxAndWhiskerCategoryDataset result
= new DefaultBoxAndWhiskerCategoryDataset();
for (int s = 0; s < SERIES_COUNT; s++) {
for (int c = 0; c < CATEGORY_COUNT; c++) {
List values = createValueList(0, 20.0, VALUE_COUNT);
values_storage[s][c]= vs;
result.add(values, "Series " + s, "Category " + c);
}
}
return result;}
else return super.createDataset(false);
}
示例13: createBoxAndWhiskerDataset
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入依赖的package包/类
private BoxAndWhiskerCategoryDataset createBoxAndWhiskerDataset(int seriesCount, int categoryCount, String[] seriesName, String[][] categoryName, double[][][] values ){
List<Double> list;
DefaultBoxAndWhiskerCategoryDataset result
= new DefaultBoxAndWhiskerCategoryDataset();
for (int s = 0; s <seriesCount; s++) {
for (int c = 0; c <categoryCount; c++) {
list = new java.util.ArrayList<Double>();
for (int i=0; i<Array.getLength(values[s][c]);i++)
list.add(new Double(values[s][c][i]));
result.add(list, seriesName[s], categoryName[s][c]);
}
}
return result;
}
示例14: createLegend
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入依赖的package包/类
protected JFreeChart createLegend(BoxAndWhiskerCategoryDataset dataset) {
CategoryAxis domainAxis = new CategoryAxis(null);
NumberAxis rangeAxis = new NumberAxis("Value");
BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
CategoryPlot plot = new CategoryPlot(
dataset, domainAxis, rangeAxis, renderer
);
JFreeChart chart = new JFreeChart(chartTitle, plot);
System.out.println(SERIES_COUNT + ","+CATEGORY_COUNT);
renderer.setLegendItemLabelGenerator(new SOCRCategoryCellLabelGenerator(dataset, values_storage, SERIES_COUNT, CATEGORY_COUNT));
return chart;
}
示例15: createItemArray
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入依赖的package包/类
/**
* Creates the array of items that can be passed to the
* {@link MessageFormat} class for creating labels.
*
* @param dataset the dataset (<code>null</code> not permitted).
* @param series the series (zero-based index).
* @param item the item (zero-based index).
*
* @return The items (never <code>null</code>).
*/
protected Object[] createItemArray(CategoryDataset dataset, int series,
int item) {
Object[] result = new Object[8];
result[0] = dataset.getRowKey(series);
Number y = dataset.getValue(series, item);
NumberFormat formatter = getNumberFormat();
result[1] = formatter.format(y);
if (dataset instanceof BoxAndWhiskerCategoryDataset) {
BoxAndWhiskerCategoryDataset d
= (BoxAndWhiskerCategoryDataset) dataset;
result[2] = formatter.format(d.getMeanValue(series, item));
result[3] = formatter.format(d.getMedianValue(series, item));
result[4] = formatter.format(d.getMinRegularValue(series, item));
result[5] = formatter.format(d.getMaxRegularValue(series, item));
result[6] = formatter.format(d.getQ1Value(series, item));
result[7] = formatter.format(d.getQ3Value(series, item));
}
return result;
}