本文整理汇总了Java中org.jfree.chart.renderer.xy.XYLineAndShapeRenderer.setDrawOutlines方法的典型用法代码示例。如果您正苦于以下问题:Java XYLineAndShapeRenderer.setDrawOutlines方法的具体用法?Java XYLineAndShapeRenderer.setDrawOutlines怎么用?Java XYLineAndShapeRenderer.setDrawOutlines使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.renderer.xy.XYLineAndShapeRenderer
的用法示例。
在下文中一共展示了XYLineAndShapeRenderer.setDrawOutlines方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addSerie
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public void addSerie(int indexSerie, Color color, XYSeries localXYSeries){
XYSeriesCollection localXYSeriesCollection = new XYSeriesCollection();
localXYSeriesCollection.addSeries(localXYSeries); //Se aniade la serie
Ellipse2D.Double localDouble = new Ellipse2D.Double(-4.0D, -4.0D, 8.0D, 8.0D); //Forma de la anotacion del punto x,y
XYLineAndShapeRenderer localXYLineAndShapeRenderer = new XYLineAndShapeRenderer();
localXYLineAndShapeRenderer.setSeriesLinesVisible(indexSerie,true); //provoca que se pinten lineas rectas que unen los puntos x,y que conforman la serie
localXYLineAndShapeRenderer.setSeriesShapesVisible(indexSerie,false); //provoca que se pinte la forma asociada al punto x,y
plot.setDataset(indexSerie, localXYSeriesCollection); //Se aniade la serie al plot
plot.setRenderer(indexSerie, localXYLineAndShapeRenderer);
localXYLineAndShapeRenderer.setSeriesShape(indexSerie, new Ellipse2D.Double(-4.0, -4.0, 8.0, 8.0));
// localXYLineAndShapeRenderer.setSeriesShape(indexSerie, localDouble);
localXYLineAndShapeRenderer.setSeriesPaint(indexSerie, color);
//localXYLineAndShapeRenderer.setSeriesFillPaint(indexSerie, Color.yellow);
//localXYLineAndShapeRenderer.setSeriesOutlinePaint(indexSerie, Color.gray);
localXYLineAndShapeRenderer.setUseFillPaint(false);//true
localXYLineAndShapeRenderer.setUseOutlinePaint(false);//true
localXYLineAndShapeRenderer.setDrawOutlines(false);
localXYLineAndShapeRenderer.setDrawSeriesLineAsPath(true);
}
示例2: addSerie
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public void addSerie(int indexSerie, Color color, XYSeries localXYSeries){
XYPlot plot=null;
XYSeriesCollection localXYSeriesCollection = new XYSeriesCollection();
localXYSeriesCollection.addSeries(localXYSeries); //Se aniade la serie
Ellipse2D.Double localDouble = new Ellipse2D.Double(-4.0D, -4.0D, 8.0D, 8.0D); //Forma de la anotacion del punto x,y
XYLineAndShapeRenderer localXYLineAndShapeRenderer = new XYLineAndShapeRenderer();
localXYLineAndShapeRenderer.setSeriesLinesVisible(indexSerie,true); //provoca que se pinten lineas rectas que unen los puntos x,y que conforman la serie
localXYLineAndShapeRenderer.setSeriesShapesVisible(indexSerie,false); //provoca que se pinte la forma asociada al punto x,y
plot.setDataset(indexSerie, localXYSeriesCollection); //Se aniade la serie al plot
plot.setRenderer(indexSerie, localXYLineAndShapeRenderer);
localXYLineAndShapeRenderer.setSeriesShape(indexSerie, new Ellipse2D.Double(-4.0, -4.0, 8.0, 8.0));
// localXYLineAndShapeRenderer.setSeriesShape(indexSerie, localDouble);
localXYLineAndShapeRenderer.setSeriesPaint(indexSerie, color);
//localXYLineAndShapeRenderer.setSeriesFillPaint(indexSerie, Color.yellow);
//localXYLineAndShapeRenderer.setSeriesOutlinePaint(indexSerie, Color.gray);
localXYLineAndShapeRenderer.setUseFillPaint(false);//true
localXYLineAndShapeRenderer.setUseOutlinePaint(false);//true
localXYLineAndShapeRenderer.setDrawOutlines(false);
localXYLineAndShapeRenderer.setDrawSeriesLineAsPath(true);
}
示例3: createChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Creates a chart.
*
* @param dataset a dataset.
*
* @return A chart based on the supplied dataset.
*/
protected JFreeChart createChart(XYDataset dataset) {
JFreeChart chart = ChartFactory.createXYLineChart(
chartTitle, // chart title
domainLabel, // x axis label
rangeLabel, // y axis label
dataset, // data
PlotOrientation.VERTICAL,
!legendPanelOn, // include legend
true, // tooltips
false // urls
);
// NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART...
// get a reference to the plot for further customisation...
XYPlot plot = (XYPlot) chart.getPlot();
XYLineAndShapeRenderer renderer
= (XYLineAndShapeRenderer) plot.getRenderer();
renderer.setBaseShapesVisible(true);
renderer.setBaseShapesFilled(true);
renderer.setDrawOutlines(true);
renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
// change the auto tick unit selection to integer units only...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
setXSummary(dataset);
return chart;
}
示例4: createXYSymbolicAxisChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private JFreeChart createXYSymbolicAxisChart(String title, XYDataset dataset) {
SymbolAxis domainAxis = new SymbolAxis("Domain",
new String[] {"A", "B", "C", "D"});
SymbolAxis rangeAxis = new SymbolAxis("Range",
new String[] {"V", "X", "Y", "Z"});
XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(false, true);
//renderer.setLegendItemLabelGenerator(new SOCRXYSeriesLabelGenerator());
XYPlot plot = new XYPlot(dataset, domainAxis, rangeAxis, renderer);
JFreeChart chart = new JFreeChart("SymbolicAxis Demo 1", plot);
if (lineCondition.indexOf("noshape")!=-1)
renderer.setBaseShapesVisible(false);
else renderer.setBaseShapesVisible(true);
if (lineCondition.indexOf("noline")!=-1)
renderer.setBaseLinesVisible(false);
if (lineCondition.indexOf("nofill")!=-1){
renderer.setBaseShapesFilled(false);
renderer.setBaseFillPaint(Color.white);
renderer.setDrawOutlines(true);}
else {
renderer.setBaseShapesFilled(true);
renderer.setUseFillPaint(false);
}
renderer.setUseFillPaint(true);
//renderer.setFillPaint(Color.white);
return chart;
}
示例5: createChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public static JFreeChart createChart(XYDataset xydataset, String shou, String shu) {
JFreeChart jfreechart = ChartFactory.createScatterPlot("Rating and Rating People Distribution", shou, shu,
xydataset, PlotOrientation.VERTICAL, true, false, false);
jfreechart.setBackgroundPaint(Color.white);
jfreechart.setBorderPaint(Color.GREEN);
XYPlot xyplot = (XYPlot) jfreechart.getPlot();
xyplot.setNoDataMessage("no data");
xyplot.setNoDataMessageFont(new Font("微软雅黑", Font.BOLD, 14));
xyplot.setNoDataMessagePaint(Color.blue);
xyplot.setBackgroundPaint(Color.lightGray);
TextTitle textTitle = jfreechart.getTitle();
textTitle.setFont(new Font("宋体", Font.BOLD, 20));
LegendTitle legend = jfreechart.getLegend();
if (legend != null) {
legend.setItemFont(new Font("宋体", Font.BOLD, 20));
}
XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) xyplot.getRenderer();
renderer.setBaseShapesVisible(true);
renderer.setDrawOutlines(true);
renderer.setSeriesOutlinePaint(0, Color.WHITE);
renderer.setUseOutlinePaint(true);
renderer.setSeriesOutlineStroke(1, new BasicStroke(0.5F));
xyplot.setRenderer(renderer);
NumberAxis numberaxis = (NumberAxis) xyplot.getDomainAxis();
numberaxis.setTickMarkInsideLength(3.0F);
numberaxis.setTickMarkOutsideLength(0.0F);
numberaxis.setUpperBound(280000);
numberaxis.setLowerBound(50000);
numberaxis.setAxisLineStroke(new BasicStroke(1.5f));
NumberAxis numberaxis1 = (NumberAxis) xyplot.getRangeAxis();
numberaxis1.setUpperBound(10.0);
numberaxis1.setLowerBound(5.0);
NumberTickUnit ntu1 = new NumberTickUnit(0.5);
numberaxis1.setTickUnit(ntu1);
return jfreechart;
}
示例6: testEquals
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Problem that the equals(...) method distinguishes all fields.
*/
public void testEquals() {
XYLineAndShapeRenderer r1 = new XYLineAndShapeRenderer();
XYLineAndShapeRenderer r2 = new XYLineAndShapeRenderer();
assertEquals(r1, r2);
assertEquals(r2, r1);
r1.setLinesVisible(true);
assertFalse(r1.equals(r2));
r2.setLinesVisible(true);
assertTrue(r1.equals(r2));
r1.setSeriesLinesVisible(3, true);
assertFalse(r1.equals(r2));
r2.setSeriesLinesVisible(3, true);
assertTrue(r1.equals(r2));
r1.setDefaultLinesVisible(false);
assertFalse(r1.equals(r2));
r2.setDefaultLinesVisible(false);
assertTrue(r1.equals(r2));
r1.setShapesVisible(true);
assertFalse(r1.equals(r2));
r2.setShapesVisible(true);
assertTrue(r1.equals(r2));
r1.setSeriesShapesVisible(3, true);
assertFalse(r1.equals(r2));
r2.setSeriesShapesVisible(3, true);
assertTrue(r1.equals(r2));
r1.setDefaultShapesVisible(false);
assertFalse(r1.equals(r2));
r2.setDefaultShapesVisible(false);
assertTrue(r1.equals(r2));
r1.setShapesFilled(true);
assertFalse(r1.equals(r2));
r2.setShapesFilled(true);
assertTrue(r1.equals(r2));
r1.setSeriesShapesFilled(3, true);
assertFalse(r1.equals(r2));
r2.setSeriesShapesFilled(3, true);
assertTrue(r1.equals(r2));
r1.setDefaultShapesFilled(false);
assertFalse(r1.equals(r2));
r2.setDefaultShapesFilled(false);
assertTrue(r1.equals(r2));
r1.setDrawOutlines(true);
assertFalse(r1.equals(r2));
r2.setDrawOutlines(true);
assertTrue(r1.equals(r2));
r1.setUseOutlinePaint(true);
assertFalse(r1.equals(r2));
r2.setUseOutlinePaint(true);
assertTrue(r1.equals(r2));
}
示例7: testEquals
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
/**
* Test that the equals() method distinguishes all fields.
*/
public void testEquals() {
XYLineAndShapeRenderer r1 = new XYLineAndShapeRenderer();
XYLineAndShapeRenderer r2 = new XYLineAndShapeRenderer();
assertEquals(r1, r2);
assertEquals(r2, r1);
r1.setLinesVisible(true);
assertFalse(r1.equals(r2));
r2.setLinesVisible(true);
assertTrue(r1.equals(r2));
r1.setSeriesLinesVisible(3, true);
assertFalse(r1.equals(r2));
r2.setSeriesLinesVisible(3, true);
assertTrue(r1.equals(r2));
r1.setBaseLinesVisible(false);
assertFalse(r1.equals(r2));
r2.setBaseLinesVisible(false);
assertTrue(r1.equals(r2));
r1.setLegendLine(new Line2D.Double(1.0, 2.0, 3.0, 4.0));
assertFalse(r1.equals(r2));
r2.setLegendLine(new Line2D.Double(1.0, 2.0, 3.0, 4.0));
assertTrue(r1.equals(r2));
r1.setShapesVisible(true);
assertFalse(r1.equals(r2));
r2.setShapesVisible(true);
assertTrue(r1.equals(r2));
r1.setSeriesShapesVisible(3, true);
assertFalse(r1.equals(r2));
r2.setSeriesShapesVisible(3, true);
assertTrue(r1.equals(r2));
r1.setBaseShapesVisible(false);
assertFalse(r1.equals(r2));
r2.setBaseShapesVisible(false);
assertTrue(r1.equals(r2));
r1.setShapesFilled(true);
assertFalse(r1.equals(r2));
r2.setShapesFilled(true);
assertTrue(r1.equals(r2));
r1.setSeriesShapesFilled(3, true);
assertFalse(r1.equals(r2));
r2.setSeriesShapesFilled(3, true);
assertTrue(r1.equals(r2));
r1.setBaseShapesFilled(false);
assertFalse(r1.equals(r2));
r2.setBaseShapesFilled(false);
assertTrue(r1.equals(r2));
r1.setDrawOutlines(!r1.getDrawOutlines());
assertFalse(r1.equals(r2));
r2.setDrawOutlines(r1.getDrawOutlines());
assertTrue(r1.equals(r2));
r1.setUseOutlinePaint(true);
assertFalse(r1.equals(r2));
r2.setUseOutlinePaint(true);
assertTrue(r1.equals(r2));
r1.setUseFillPaint(true);
assertFalse(r1.equals(r2));
r2.setUseFillPaint(true);
assertTrue(r1.equals(r2));
r1.setDrawSeriesLineAsPath(true);
assertFalse(r1.equals(r2));
r2.setDrawSeriesLineAsPath(true);
assertTrue(r1.equals(r2));
}
示例8: createLineChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private JFreeChart createLineChart(String title, String xLabel, String yLabel, XYDataset dataset, String other) {
// create the chart...
JFreeChart chart = ChartFactory.createXYLineChart(
title, // chart title
xLabel, // domain axis label
yLabel, // range axis label
dataset, // data
PlotOrientation.VERTICAL, // orientation
false, // include legend
true, // tooltips
false // urls
);
chart.setBackgroundPaint(Color.white);
XYPlot plot = chart.getXYPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setRangeGridlinePaint(Color.white);
plot.setDomainGridlinePaint(Color.white);
//plot.setNoDataMessage("No data available");
// customise the range axis...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
//rangeAxis.setAutoRange(false);
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
// domainAxis.setAutoRange(false);
domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
// customise the renderer...
XYLineAndShapeRenderer renderer
= (XYLineAndShapeRenderer) plot.getRenderer();
renderer.setBaseShapesVisible(true);
renderer.setBaseLinesVisible(false);
renderer.setDrawOutlines(true);
renderer.setBaseShapesFilled(true);
renderer.setUseFillPaint(true);
//renderer.setFillPaint(Color.white);
if (other.toLowerCase().indexOf("noshape")!=-1){
renderer.setBaseShapesVisible(false);
renderer.setBaseLinesVisible(true);
}
if (other.toLowerCase().indexOf("excludeszero")!=-1){
rangeAxis.setAutoRangeIncludesZero(false);
domainAxis.setAutoRangeIncludesZero(false);
}
return chart;
}
示例9: createLineChart
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private JFreeChart createLineChart(String title, String xLabel, String yLabel, XYDataset dataset, String other) {
// create the chart...
JFreeChart chart = ChartFactory.createXYLineChart(
title, // chart title
xLabel, // domain axis label
yLabel, // range axis label
dataset, // data
PlotOrientation.VERTICAL, // orientation
true, // include legend
true, // tooltips
false // urls
);
XYPlot plot = chart.getXYPlot();
chart.setBackgroundPaint(Color.white);
plot.setRangeGridlinePaint(Color.lightGray);
plot.setDomainGridlinePaint(Color.lightGray);
//plot.setNoDataMessage("No data available");
// customise the range axis...
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis();
domainAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
rangeAxis.setUpperMargin(0.02);
rangeAxis.setLowerMargin(0.02);
domainAxis.setUpperMargin(0.02);
domainAxis.setLowerMargin(0.02);
// customise the renderer...
XYLineAndShapeRenderer renderer
= (XYLineAndShapeRenderer) plot.getRenderer();
renderer.setBaseShapesVisible(true);
renderer.setBaseLinesVisible(true);
renderer.setDrawOutlines(true);
renderer.setBaseShapesFilled(true);
renderer.setUseFillPaint(true);
renderer.setBaseFillPaint(Color.white);
if (other.toLowerCase().indexOf("noline")!=-1){
renderer.setBaseShapesVisible(true);
renderer.setBaseLinesVisible(false);
}
if (other.toLowerCase().indexOf("noshape")!=-1){
renderer.setBaseShapesVisible(false);
renderer.setBaseLinesVisible(true);
}
if (other.toLowerCase().indexOf("excludeszero")!=-1){
rangeAxis.setAutoRangeIncludesZero(false);
domainAxis.setAutoRangeIncludesZero(false);
}
return chart;
}
示例10: configureRenderer
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private void configureRenderer(MsSpectrumDataSet dataset, int datasetIndex) {
final MsSpectrumType renderingType = dataset.getRenderingType();
final XYPlot plot = chartNode.getChart().getXYPlot();
// Set renderer
AbstractXYItemRenderer newRenderer;
switch (renderingType) {
case PROFILE:
case THRESHOLDED:
XYLineAndShapeRenderer newLineRenderer = new XYLineAndShapeRenderer();
final int lineThickness = dataset.getLineThickness();
newLineRenderer.setBaseShape(new Ellipse2D.Double(-2 * lineThickness, -2 * lineThickness,
4 * lineThickness + 1, 4 * lineThickness + 1));
newLineRenderer.setBaseShapesFilled(true);
newLineRenderer.setBaseShapesVisible(dataset.getShowDataPoints());
newLineRenderer.setDrawOutlines(false);
Stroke baseStroke = new BasicStroke(lineThickness);
newLineRenderer.setBaseStroke(baseStroke);
newRenderer = newLineRenderer;
break;
case CENTROIDED:
default:
XYBarRenderer newBarRenderer = new XYBarRenderer();
// Avoid gradients
newBarRenderer.setBarPainter(new StandardXYBarPainter());
newBarRenderer.setShadowVisible(false);
newRenderer = newBarRenderer;
break;
}
// Set tooltips for legend
newRenderer.setLegendItemToolTipGenerator((ds, series) -> {
if (ds instanceof MsSpectrumDataSet) {
return ((MsSpectrumDataSet) ds).getDescription();
} else
return null;
});
// Set color
Color baseColor = dataset.getColor();
newRenderer.setBasePaint(JavaFXUtil.convertColorToAWT(baseColor));
// Set label generator
XYItemLabelGenerator intelligentLabelGenerator =
new IntelligentItemLabelGenerator(chartNode, 100, dataset);
newRenderer.setBaseItemLabelGenerator(intelligentLabelGenerator);
newRenderer.setBaseItemLabelPaint(JavaFXUtil.convertColorToAWT(labelsColor));
newRenderer.setBaseItemLabelsVisible(itemLabelsVisible.get());
// Set tooltip generator
newRenderer.setBaseToolTipGenerator(dataset);
plot.setRenderer(datasetIndex, newRenderer);
}
示例11: configureRenderer
import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private void configureRenderer(ChromatogramPlotDataSet dataset, int datasetIndex) {
final XYPlot plot = chartNode.getChart().getXYPlot();
XYLineAndShapeRenderer newRenderer = new XYLineAndShapeRenderer();
final int lineThickness = dataset.getLineThickness();
newRenderer.setBaseShape(new Ellipse2D.Double(-2 * lineThickness, -2 * lineThickness,
4 * lineThickness + 1, 4 * lineThickness + 1));
newRenderer.setBaseShapesFilled(true);
newRenderer.setBaseShapesVisible(dataset.getShowDataPoints());
newRenderer.setDrawOutlines(false);
Stroke baseStroke = new BasicStroke(lineThickness);
newRenderer.setBaseStroke(baseStroke);
// Set tooltips for legend
newRenderer.setLegendItemToolTipGenerator((ds, series) -> {
if (ds instanceof ChromatogramPlotDataSet) {
return ((ChromatogramPlotDataSet) ds).getDescription();
} else
return null;
});
// Set color
Color baseColor = dataset.getColor();
newRenderer.setBasePaint(JavaFXUtil.convertColorToAWT(baseColor));
// Set label generator
XYItemLabelGenerator intelligentLabelGenerator =
new IntelligentItemLabelGenerator(chartNode, 100, dataset);
newRenderer.setBaseItemLabelGenerator(intelligentLabelGenerator);
newRenderer.setBaseItemLabelPaint(JavaFXUtil.convertColorToAWT(labelsColor));
newRenderer.setBaseItemLabelsVisible(itemLabelsVisible.get());
newRenderer.setBaseItemLabelsVisible(true);
// Set tooltip generator
newRenderer.setBaseToolTipGenerator(dataset);
plot.setRenderer(datasetIndex, newRenderer);
}