本文整理汇总了Java中org.jfree.chart.renderer.category.BoxAndWhiskerRenderer.setItemMargin方法的典型用法代码示例。如果您正苦于以下问题:Java BoxAndWhiskerRenderer.setItemMargin方法的具体用法?Java BoxAndWhiskerRenderer.setItemMargin怎么用?Java BoxAndWhiskerRenderer.setItemMargin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.renderer.category.BoxAndWhiskerRenderer
的用法示例。
在下文中一共展示了BoxAndWhiskerRenderer.setItemMargin方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testEquals
import org.jfree.chart.renderer.category.BoxAndWhiskerRenderer; //导入方法依赖的package包/类
/**
* Test that the equals() method distinguishes all fields.
*/
public void testEquals() {
BoxAndWhiskerRenderer r1 = new BoxAndWhiskerRenderer();
BoxAndWhiskerRenderer r2 = new BoxAndWhiskerRenderer();
assertEquals(r1, r2);
r1.setArtifactPaint(Color.yellow);
assertFalse(r1.equals(r2));
r2.setArtifactPaint(Color.yellow);
assertEquals(r1, r2);
r1.setFillBox(!r1.getFillBox());
assertFalse(r1.equals(r2));
r2.setFillBox(!r2.getFillBox());
assertEquals(r1, r2);
r1.setItemMargin(0.11);
assertFalse(r1.equals(r2));
r2.setItemMargin(0.11);
assertEquals(r1, r2);
}
示例2: testEquals
import org.jfree.chart.renderer.category.BoxAndWhiskerRenderer; //导入方法依赖的package包/类
/**
* Test that the equals() method distinguishes all fields.
*/
public void testEquals() {
BoxAndWhiskerRenderer r1 = new BoxAndWhiskerRenderer();
BoxAndWhiskerRenderer r2 = new BoxAndWhiskerRenderer();
assertEquals(r1, r2);
r1.setArtifactPaint(new GradientPaint(1.0f, 2.0f, Color.yellow,
3.0f, 4.0f, Color.blue));
assertFalse(r1.equals(r2));
r2.setArtifactPaint(new GradientPaint(1.0f, 2.0f, Color.yellow,
3.0f, 4.0f, Color.blue));
assertEquals(r1, r2);
r1.setFillBox(!r1.getFillBox());
assertFalse(r1.equals(r2));
r2.setFillBox(!r2.getFillBox());
assertEquals(r1, r2);
r1.setItemMargin(0.11);
assertFalse(r1.equals(r2));
r2.setItemMargin(0.11);
assertEquals(r1, r2);
}
示例3: boxWhiskerPlot
import org.jfree.chart.renderer.category.BoxAndWhiskerRenderer; //导入方法依赖的package包/类
/**
* Plots Data for Chart
*/
private void boxWhiskerPlot() {
BoxAndWhiskerCategoryDataset dataset = createDataset();
CategoryAxis xAxis = new CategoryAxis("Model");
NumberAxis yAxis = new NumberAxis("Fitness");
yAxis.setRange(0.0, 1.0);
BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer();
renderer.setFillBox(false);
renderer.setMaximumBarWidth(0.2);
renderer.setItemMargin(0.5);
renderer.setToolTipGenerator(new BoxAndWhiskerToolTipGenerator());
CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer);
plot.setOrientation(PlotOrientation.HORIZONTAL);
chart = new JFreeChart(
"Model comparison",
new Font("Palatino", Font.BOLD, 14),
plot,
true
);
chart.removeLegend();
// boxWhiskerPane.setCenter(viewer);
}
示例4: testEquals
import org.jfree.chart.renderer.category.BoxAndWhiskerRenderer; //导入方法依赖的package包/类
/**
* Test that the equals() method distinguishes all fields.
*/
public void testEquals() {
BoxAndWhiskerRenderer r1 = new BoxAndWhiskerRenderer();
BoxAndWhiskerRenderer r2 = new BoxAndWhiskerRenderer();
assertEquals(r1, r2);
r1.setArtifactPaint(new GradientPaint(1.0f, 2.0f, Color.yellow,
3.0f, 4.0f, Color.blue));
assertFalse(r1.equals(r2));
r2.setArtifactPaint(new GradientPaint(1.0f, 2.0f, Color.yellow,
3.0f, 4.0f, Color.blue));
assertEquals(r1, r2);
r1.setFillBox(!r1.getFillBox());
assertFalse(r1.equals(r2));
r2.setFillBox(!r2.getFillBox());
assertEquals(r1, r2);
r1.setItemMargin(0.11);
assertFalse(r1.equals(r2));
r2.setItemMargin(0.11);
assertEquals(r1, r2);
r1.setMaximumBarWidth(0.99);
assertFalse(r1.equals(r2));
r2.setMaximumBarWidth(0.99);
assertTrue(r1.equals(r2));
// the default for meanVisible is false in 1.2.x
r1.setMeanVisible(true);
assertFalse(r1.equals(r2));
r2.setMeanVisible(true);
assertTrue(r1.equals(r2));
r1.setMedianVisible(false);
assertFalse(r1.equals(r2));
r2.setMedianVisible(false);
assertTrue(r1.equals(r2));
}
示例5: createBoxAndWhiskerChart
import org.jfree.chart.renderer.category.BoxAndWhiskerRenderer; //导入方法依赖的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;
}
示例6: createChart
import org.jfree.chart.renderer.category.BoxAndWhiskerRenderer; //导入方法依赖的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;
}
示例7: createChart
import org.jfree.chart.renderer.category.BoxAndWhiskerRenderer; //导入方法依赖的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;
}
示例8: createBoxAndWhiskerChart
import org.jfree.chart.renderer.category.BoxAndWhiskerRenderer; //导入方法依赖的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;
}
示例9: createBoxAndWhiskerChart
import org.jfree.chart.renderer.category.BoxAndWhiskerRenderer; //导入方法依赖的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;
}