本文整理汇总了Java中org.jfree.data.statistics.BoxAndWhiskerXYDataset类的典型用法代码示例。如果您正苦于以下问题:Java BoxAndWhiskerXYDataset类的具体用法?Java BoxAndWhiskerXYDataset怎么用?Java BoxAndWhiskerXYDataset使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BoxAndWhiskerXYDataset类属于org.jfree.data.statistics包,在下文中一共展示了BoxAndWhiskerXYDataset类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBoxAndWhiskerChart
import org.jfree.data.statistics.BoxAndWhiskerXYDataset; //导入依赖的package包/类
/**
* Creates and returns a default instance of a box and whisker chart.
*
* @param title the chart title (<code>null</code> permitted).
* @param timeAxisLabel a label for the time 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.
*/
public static JFreeChart createBoxAndWhiskerChart(String title,
String timeAxisLabel,
String valueAxisLabel,
BoxAndWhiskerXYDataset dataset,
boolean legend) {
ValueAxis timeAxis = new DateAxis(timeAxisLabel);
NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
valueAxis.setAutoRangeIncludesZero(false);
XYBoxAndWhiskerRenderer renderer = new XYBoxAndWhiskerRenderer(10.0);
XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
return chart;
}
示例2: createItemArray
import org.jfree.data.statistics.BoxAndWhiskerXYDataset; //导入依赖的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(XYDataset dataset, int series, int item) {
Object[] result = new Object[8];
result[0] = dataset.getSeriesName(series);
Number x = dataset.getX(series, item);
if (getXDateFormat() != null) {
result[1] = getXDateFormat().format(new Date(x.longValue()));
}
else {
result[1] = getXFormat().format(x);
}
NumberFormat formatter = getYFormat();
if (dataset instanceof BoxAndWhiskerXYDataset) {
BoxAndWhiskerXYDataset d = (BoxAndWhiskerXYDataset) 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;
}
示例3: createBoxAndWhiskerChart
import org.jfree.data.statistics.BoxAndWhiskerXYDataset; //导入依赖的package包/类
/**
* Creates and returns a default instance of a box and whisker chart.
*
* @param title the chart title (<code>null</code> permitted).
* @param timeAxisLabel a label for the time 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.
*/
public static JFreeChart createBoxAndWhiskerChart(String title,
String timeAxisLabel,
String valueAxisLabel,
BoxAndWhiskerXYDataset dataset,
boolean legend) {
ValueAxis timeAxis = new DateAxis(timeAxisLabel);
NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
valueAxis.setAutoRangeIncludesZero(false);
XYBoxAndWhiskerRenderer renderer = new XYBoxAndWhiskerRenderer(10.0);
XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
return new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot,
legend);
}
示例4: createItemArray
import org.jfree.data.statistics.BoxAndWhiskerXYDataset; //导入依赖的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(XYDataset dataset, int series,
int item) {
Object[] result = new Object[8];
result[0] = dataset.getSeriesKey(series).toString();
Number x = dataset.getX(series, item);
if (getXDateFormat() != null) {
result[1] = getXDateFormat().format(new Date(x.longValue()));
}
else {
result[1] = getXFormat().format(x);
}
NumberFormat formatter = getYFormat();
if (dataset instanceof BoxAndWhiskerXYDataset) {
BoxAndWhiskerXYDataset d = (BoxAndWhiskerXYDataset) 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;
}
示例5: createBoxAndWhiskerChart
import org.jfree.data.statistics.BoxAndWhiskerXYDataset; //导入依赖的package包/类
/**
* Creates and returns a default instance of a box and whisker chart.
*
* @param title the chart title (<code>null</code> permitted).
* @param timeAxisLabel a label for the time 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.
*/
public static JFreeChart createBoxAndWhiskerChart(String title,
String timeAxisLabel, String valueAxisLabel,
BoxAndWhiskerXYDataset dataset, boolean legend) {
ValueAxis timeAxis = new DateAxis(timeAxisLabel);
NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
valueAxis.setAutoRangeIncludesZero(false);
XYBoxAndWhiskerRenderer renderer = new XYBoxAndWhiskerRenderer(10.0);
XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
currentTheme.apply(chart);
return chart;
}
示例6: createItemArray
import org.jfree.data.statistics.BoxAndWhiskerXYDataset; //导入依赖的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(XYDataset dataset, int series,
int item) {
Object[] result = new Object[8];
result[0] = dataset.getSeriesKey(series).toString();
Number x = dataset.getX(series, item);
if (getXDateFormat() != null) {
result[1] = getXDateFormat().format(new Date(x.longValue()));
}
else {
result[1] = getXFormat().format(x);
}
NumberFormat formatter = getYFormat();
if (dataset instanceof BoxAndWhiskerXYDataset) {
BoxAndWhiskerXYDataset d = (BoxAndWhiskerXYDataset) 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;
}
示例7: createBoxAndWhiskerChart
import org.jfree.data.statistics.BoxAndWhiskerXYDataset; //导入依赖的package包/类
/**
* Creates and returns a default instance of a box and whisker chart.
*
* @param title the chart title ({@code null} permitted).
* @param timeAxisLabel a label for the time 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.
*/
public static JFreeChart createBoxAndWhiskerChart(String title,
String timeAxisLabel, String valueAxisLabel,
BoxAndWhiskerXYDataset dataset, boolean legend) {
ValueAxis timeAxis = new DateAxis(timeAxisLabel);
NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
valueAxis.setAutoRangeIncludesZero(false);
XYBoxAndWhiskerRenderer renderer = new XYBoxAndWhiskerRenderer(10.0);
XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
currentTheme.apply(chart);
return chart;
}
示例8: createItemArray
import org.jfree.data.statistics.BoxAndWhiskerXYDataset; //导入依赖的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(XYDataset dataset, int series,
int item) {
Object[] result = new Object[8];
result[0] = dataset.getSeriesKey(series).toString();
Number x = dataset.getX(series, item);
if (getXDateFormat() != null) {
result[1] = getXDateFormat().format(new Date(x.longValue()));
}
else {
result[1] = getXFormat().format(x);
}
NumberFormat formatter = getYFormat();
if (dataset instanceof BoxAndWhiskerXYDataset) {
BoxAndWhiskerXYDataset d = (BoxAndWhiskerXYDataset) 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;
}
示例9: createBoxAndWhiskerChart
import org.jfree.data.statistics.BoxAndWhiskerXYDataset; //导入依赖的package包/类
/**
* Creates and returns a default instance of a box and whisker chart.
*
* @param title the chart title (<code>null</code> permitted).
* @param timeAxisLabel a label for the time 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.
*/
public static JFreeChart createBoxAndWhiskerChart(String title,
String timeAxisLabel,
String valueAxisLabel,
BoxAndWhiskerXYDataset dataset,
boolean legend) {
ValueAxis timeAxis = new DateAxis(timeAxisLabel);
NumberAxis valueAxis = new NumberAxis(valueAxisLabel);
valueAxis.setAutoRangeIncludesZero(false);
XYBoxAndWhiskerRenderer renderer = new XYBoxAndWhiskerRenderer(10.0);
XYPlot plot = new XYPlot(dataset, timeAxis, valueAxis, renderer);
JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
plot, legend);
currentTheme.apply(chart);
return chart;
}
示例10: createItemArray
import org.jfree.data.statistics.BoxAndWhiskerXYDataset; //导入依赖的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(XYDataset dataset, int series,
int item) {
Object[] result = new Object[8];
result[0] = dataset.getSeriesKey(series).toString();
Number x = dataset.getX(series, item);
if (getXDateFormat() != null) {
result[1] = getXDateFormat().format(new Date(x.longValue()));
}
else {
result[1] = getXFormat().format(x);
}
NumberFormat formatter = getYFormat();
if (dataset instanceof BoxAndWhiskerXYDataset) {
BoxAndWhiskerXYDataset d = (BoxAndWhiskerXYDataset) 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;
}
示例11: createChart
import org.jfree.data.statistics.BoxAndWhiskerXYDataset; //导入依赖的package包/类
public JFreeChart createChart() {
JFreeChart chart;
if (getDataset() instanceof BoxAndWhiskerXYDataset) {
chart = ChartFactory.createBoxAndWhiskerChart(getTitle(),
getTimeAxisLabel(), getValueAxisLabel(),
(BoxAndWhiskerXYDataset)getDataset(), isLegend());
}
else {
chart = ChartFactory.createBoxAndWhiskerChart(getTitle(),
getTimeAxisLabel(), getValueAxisLabel(),
(BoxAndWhiskerCategoryDataset)getDataset(), isLegend());
}
return setExtraProperties(chart);
}
示例12: getBoxAndWhiskerXYDataset
import org.jfree.data.statistics.BoxAndWhiskerXYDataset; //导入依赖的package包/类
public BoxAndWhiskerXYDataset getBoxAndWhiskerXYDataset()
{
return this.vBoxAndWhiskerXYDataset;
}