本文整理汇总了Java中org.jfree.data.statistics.BoxAndWhiskerCategoryDataset.getColumnCount方法的典型用法代码示例。如果您正苦于以下问题:Java BoxAndWhiskerCategoryDataset.getColumnCount方法的具体用法?Java BoxAndWhiskerCategoryDataset.getColumnCount怎么用?Java BoxAndWhiskerCategoryDataset.getColumnCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.data.statistics.BoxAndWhiskerCategoryDataset
的用法示例。
在下文中一共展示了BoxAndWhiskerCategoryDataset.getColumnCount方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createBoxAndWhiskerChart
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入方法依赖的package包/类
private JFreeChart createBoxAndWhiskerChart(String title, String xLabel, String yLabel, BoxAndWhiskerCategoryDataset dataset) {
CategoryAxis domainAxis = new CategoryAxis(xLabel);
NumberAxis rangeAxis = new NumberAxis(yLabel);
// CategoryItemRenderer renderer = new BoxAndWhiskerRenderer();
BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
CategoryPlot plot = new CategoryPlot(
dataset, domainAxis, rangeAxis, renderer
);
JFreeChart chart = new JFreeChart(title, plot);
chart.setBackgroundPaint(Color.white);
plot.setBackgroundPaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.white);
plot.setDomainGridlinesVisible(true);
plot.setRangeGridlinePaint(Color.white);
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
//columnCount -- category count
//RowCount -- serie count
if(dataset.getColumnCount()* dataset.getRowCount()<5){
domainAxis.setLowerMargin(0.2);
domainAxis.setUpperMargin(0.2);
if (dataset.getColumnCount()==1)
renderer.setItemMargin(0.5);
// domainAxis.setCategoryMargin(domainAxis.getCategoryMargin()*2);
/* System.out.println("lowerMargin="+domainAxis.getLowerMargin());
System.out.println("ItemMargin="+renderer.getItemMargin());
System.out.println("CategoryMargin="+domainAxis.getCategoryMargin());*/
}
else if(dataset.getColumnCount()* dataset.getRowCount()<10){
domainAxis.setLowerMargin(domainAxis.getLowerMargin()*2);
domainAxis.setUpperMargin(domainAxis.getUpperMargin()*2);
if (dataset.getColumnCount()==1)
renderer.setItemMargin(renderer.getItemMargin()*2);
else
domainAxis.setCategoryMargin(domainAxis.getCategoryMargin()*2);
/*System.out.println("lowerMargin="+domainAxis.getLowerMargin());
System.out.println("ItemMargin="+renderer.getItemMargin());
System.out.println("CategoryMargin="+domainAxis.getCategoryMargin());
*/
}
return chart;
}
示例2: createChart
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入方法依赖的package包/类
/**
* Creates a sample chart.
*
* @param dataset the dataset.
*
* @return The chart.
*/
protected JFreeChart createChart(BoxAndWhiskerCategoryDataset dataset) {
CategoryAxis domainAxis = new CategoryAxis(null);
NumberAxis rangeAxis = new NumberAxis(rangeLabel);
BoxAndWhiskerRenderer 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());
renderer.setLegendItemLabelGenerator(new SOCRCategoryCellLabelGenerator(dataset, values_storage,SERIES_COUNT, CATEGORY_COUNT));
//RowCount -- serie count
if(dataset.getColumnCount()* dataset.getRowCount()<5){
domainAxis.setLowerMargin(0.2);
domainAxis.setUpperMargin(0.2);
if (dataset.getColumnCount()==1)
renderer.setItemMargin(0.5);
// domainAxis.setCategoryMargin(domainAxis.getCategoryMargin()*2);
/*
System.out.println("1lowerMargin="+domainAxis.getLowerMargin());
System.out.println("ItemMargin="+renderer.getItemMargin());
System.out.println("CategoryMargin="+domainAxis.getCategoryMargin());*/
}
else if(dataset.getColumnCount()* dataset.getRowCount()<10){
domainAxis.setLowerMargin(domainAxis.getLowerMargin()*2);
domainAxis.setUpperMargin(domainAxis.getUpperMargin()*2);
if (dataset.getColumnCount()==1)
renderer.setItemMargin(renderer.getItemMargin()*2);
else
domainAxis.setCategoryMargin(domainAxis.getCategoryMargin()*2);
/*System.out.println("2lowerMargin="+domainAxis.getLowerMargin());
System.out.println("ItemMargin="+renderer.getItemMargin());
System.out.println("CategoryMargin="+domainAxis.getCategoryMargin());*/
}
if (legendPanelOn)
chart.removeLegend();
return chart;
}
示例3: createChart
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入方法依赖的package包/类
/**
* Creates a sample chart.
*
* @param dataset the dataset.
*
* @return The chart.
*/
protected JFreeChart createChart(BoxAndWhiskerCategoryDataset dataset) {
CategoryAxis domainAxis = new CategoryAxis(null);
NumberAxis rangeAxis = new NumberAxis(rangeLabel);
BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
CategoryPlot plot = new CategoryPlot(
dataset, domainAxis, rangeAxis, renderer
);
JFreeChart chart = new JFreeChart(chartTitle, plot);
plot.setOrientation(PlotOrientation.HORIZONTAL);
chart.setBackgroundPaint(Color.white);
plot.setBackgroundPaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.white);
plot.setDomainGridlinesVisible(true);
plot.setRangeGridlinePaint(Color.white);
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
renderer.setLegendItemLabelGenerator(new SOCRCategoryCellLabelGenerator(dataset, values_storage,SERIES_COUNT, CATEGORY_COUNT));
//columnCount -- category count
//RowCount -- serie count
domainAxis.setLowerMargin(0.44);
domainAxis.setUpperMargin(0.44);
if (dataset.getColumnCount()==1)
renderer.setItemMargin(0.5);
// domainAxis.setCategoryMargin(domainAxis.getCategoryMargin()*2);
/*
System.out.println("1lowerMargin="+domainAxis.getLowerMargin());
System.out.println("ItemMargin="+renderer.getItemMargin());
System.out.println("CategoryMargin="+domainAxis.getCategoryMargin());*/
renderer.setItemMargin(renderer.getItemMargin()*2);
/*System.out.println("2lowerMargin="+domainAxis.getLowerMargin());
System.out.println("ItemMargin="+renderer.getItemMargin());
System.out.println("CategoryMargin="+domainAxis.getCategoryMargin());*/
return chart;
}
示例4: createBoxAndWhiskerChart
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入方法依赖的package包/类
private JFreeChart createBoxAndWhiskerChart(String title, String xLabel, String yLabel, BoxAndWhiskerCategoryDataset dataset) {
CategoryAxis domainAxis = new CategoryAxis(xLabel);
NumberAxis rangeAxis = new NumberAxis(yLabel);
// CategoryItemRenderer renderer = new BoxAndWhiskerRenderer();
BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
CategoryPlot plot = new CategoryPlot(
dataset, domainAxis, rangeAxis, renderer
);
JFreeChart chart = new JFreeChart(title, plot);
chart.setBackgroundPaint(Color.white);
plot.setBackgroundPaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.white);
plot.setDomainGridlinesVisible(true);
plot.setRangeGridlinePaint(Color.white);
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
//columnCount -- category count
//RowCount -- serie count
if(dataset.getColumnCount()* dataset.getRowCount()<5){
domainAxis.setLowerMargin(0.2);
domainAxis.setUpperMargin(0.2);
if (dataset.getColumnCount()==1)
renderer.setItemMargin(0.5);
// domainAxis.setCategoryMargin(domainAxis.getCategoryMargin()*2);
}
else if(dataset.getColumnCount()* dataset.getRowCount()<10){
domainAxis.setLowerMargin(domainAxis.getLowerMargin()*2);
domainAxis.setUpperMargin(domainAxis.getUpperMargin()*2);
if (dataset.getColumnCount()==1)
renderer.setItemMargin(renderer.getItemMargin()*2);
else
domainAxis.setCategoryMargin(domainAxis.getCategoryMargin()*2);
}
return chart;
}
示例5: createBoxAndWhiskerChart
import org.jfree.data.statistics.BoxAndWhiskerCategoryDataset; //导入方法依赖的package包/类
private JFreeChart createBoxAndWhiskerChart(String title, String xLabel, String yLabel, BoxAndWhiskerCategoryDataset dataset) {
CategoryAxis domainAxis = new CategoryAxis(xLabel);
NumberAxis rangeAxis = new NumberAxis(yLabel);
// CategoryItemRenderer renderer = new BoxAndWhiskerRenderer();
BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
CategoryPlot plot = new CategoryPlot(
dataset, domainAxis, rangeAxis, renderer
);
JFreeChart chart = new JFreeChart(title, plot);
chart.setBackgroundPaint(Color.white);
plot.setBackgroundPaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.white);
plot.setDomainGridlinesVisible(true);
plot.setRangeGridlinePaint(Color.white);
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
//columnCount -- category count
//RowCount -- serie count
if(dataset.getColumnCount()* dataset.getRowCount()<5){
domainAxis.setLowerMargin(0.2);
domainAxis.setUpperMargin(0.2);
if (dataset.getColumnCount()==1)
renderer.setItemMargin(0.5);
// domainAxis.setCategoryMargin(domainAxis.getCategoryMargin()*2);
//System.out.println("lowerMargin="+domainAxis.getLowerMargin());
//System.out.println("ItemMargin="+renderer.getItemMargin());
//System.out.println("CategoryMargin="+domainAxis.getCategoryMargin());
}
else if(dataset.getColumnCount()* dataset.getRowCount()<10){
domainAxis.setLowerMargin(domainAxis.getLowerMargin()*2);
domainAxis.setUpperMargin(domainAxis.getUpperMargin()*2);
if (dataset.getColumnCount()==1)
renderer.setItemMargin(renderer.getItemMargin()*2);
else
domainAxis.setCategoryMargin(domainAxis.getCategoryMargin()*2);
//System.out.println("lowerMargin="+domainAxis.getLowerMargin());
//System.out.println("ItemMargin="+renderer.getItemMargin());
//System.out.println("CategoryMargin="+domainAxis.getCategoryMargin());
}
return chart;
}