当前位置: 首页>>代码示例>>Java>>正文


Java XYLineAndShapeRenderer.setShapesVisible方法代码示例

本文整理汇总了Java中org.jfree.chart.renderer.xy.XYLineAndShapeRenderer.setShapesVisible方法的典型用法代码示例。如果您正苦于以下问题:Java XYLineAndShapeRenderer.setShapesVisible方法的具体用法?Java XYLineAndShapeRenderer.setShapesVisible怎么用?Java XYLineAndShapeRenderer.setShapesVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jfree.chart.renderer.xy.XYLineAndShapeRenderer的用法示例。


在下文中一共展示了XYLineAndShapeRenderer.setShapesVisible方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPlot

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public static JFreeChart getPlot(double[] xData, double[] yData, String title, String xlabel, String ylabel)
{

	XYSeriesCollection datCol = getCollection(xData, yData, "Data");

	// Create the chart

	JFreeChart chart = ChartFactory.createXYLineChart(title, // Title
	xlabel, // X-Axis label
	ylabel, // Y-Axis label
	new XYSeriesCollection(), // Dataset
	PlotOrientation.VERTICAL, true, // Show legend
	true, true);

	// Add the series
	chart.getXYPlot().setDataset(0, datCol);

	// Set the rendering
	XYLineAndShapeRenderer rend1 = new XYLineAndShapeRenderer(true, true);
	rend1.setShapesVisible(false);
	chart.getXYPlot().setRenderer(0, rend1);

	return chart;
}
 
开发者ID:TOMIGalway,项目名称:cmoct-sourcecode,代码行数:25,代码来源:PlotingToolkit.java

示例2: Grafico

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public Grafico(String frametitle, String charttitle, String xlabel, String ylabel, XYSeriesCollection dataset){
	JFreeChart chart = ChartFactory.createXYLineChart(charttitle, xlabel, ylabel, dataset, PlotOrientation.VERTICAL, true, true, false);

	XYPlot plot = (XYPlot) chart.getPlot();

	plot.setBackgroundPaint(Color.lightGray);
	plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
	plot.setDomainGridlinePaint(Color.white);
	plot.setRangeGridlinePaint(Color.white);
	XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer();
	renderer.setShapesVisible(true);
	renderer.setShapesFilled(true);

	setXyplot(plot);
	setChart(chart);

	ChartFrame frame= new ChartFrame(frametitle,chart);

	frame.pack();
	frame.setVisible(true);
}
 
开发者ID:CST-Group,项目名称:cst,代码行数:22,代码来源:Grafico.java

示例3: getRenderer0

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private XYLineAndShapeRenderer getRenderer0() {
	// TODO Auto-generated method stub
	XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
	renderer.setShapesVisible(false); 
	renderer.setShapesFilled(false);
	renderer.setPaint(Color.gray);
	return renderer;
}
 
开发者ID:c-zhou,项目名称:polyGembler,代码行数:9,代码来源:JfreeChart.java

示例4: getRenderer1

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private XYLineAndShapeRenderer getRenderer1() {
	// TODO Auto-generated method stub
	XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
	renderer.setPaint(Color.decode(hex_str[4]));
	renderer.setShapesVisible(true);
	renderer.setShapesFilled(true);
	renderer.setShape(shape);
	return renderer;
}
 
开发者ID:c-zhou,项目名称:polyGembler,代码行数:10,代码来源:JfreeChart.java

示例5: getRenderer2

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private XYLineAndShapeRenderer getRenderer2() {
	// TODO Auto-generated method stub
	XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
	renderer.setStroke(new BasicStroke(stroke));
	renderer.setPaint(Color.DARK_GRAY);
	renderer.setShapesVisible(false);
	renderer.setShapesFilled(false);
	return renderer;
}
 
开发者ID:c-zhou,项目名称:polyGembler,代码行数:10,代码来源:JfreeChart.java

示例6: getRenderer3

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private XYLineAndShapeRenderer getRenderer3() {
	// TODO Auto-generated method stub
	XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
	renderer.setStroke(new BasicStroke(stroke));
	renderer.setPaint(Color.DARK_GRAY);
	renderer.setShapesVisible(false);
	renderer.setShapesFilled(false);
	return renderer;
}
 
开发者ID:c-zhou,项目名称:polyGembler,代码行数:10,代码来源:JfreeChart.java

示例7: getRenderer4

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private XYItemRenderer getRenderer4() {
	// TODO Auto-generated method stub
	XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
	renderer.setStroke(new BasicStroke(stroke/4));
	Color c = Color.decode(hex_str[0]);
	renderer.setPaint(c);
	renderer.setShapesVisible(false);
	renderer.setShapesFilled(false);
	return renderer;
}
 
开发者ID:c-zhou,项目名称:polyGembler,代码行数:11,代码来源:JfreeChart.java

示例8: getRenderer5

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
private XYLineAndShapeRenderer getRenderer5() {
	// TODO Auto-generated method stub
	XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
	renderer.setStroke(new BasicStroke(3));
	renderer.setPaint(Color.DARK_GRAY);
	renderer.setShapesVisible(false);
	renderer.setShapesFilled(false);
	return renderer;
}
 
开发者ID:c-zhou,项目名称:polyGembler,代码行数:10,代码来源:JfreeChart.java

示例9: 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));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:65,代码来源:XYLineAndShapeRendererTests.java

示例10: 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));
}
 
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:81,代码来源:XYLineAndShapeRendererTests.java

示例11: createLineChart

import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; //导入方法依赖的package包/类
public static JFreeChart createLineChart(String chartTitle, String chartXdesc, String chartYdesc,
                                             String periodType, int dateInterval, String timeFormat, XYDataset dataSet) {
        JFreeChart chart = ChartFactory.createTimeSeriesChart(
                chartTitle, chartXdesc, chartYdesc, dataSet, true, false, false
        );
        StandardChartTheme chartTheme = new StandardChartTheme("CN");
        ChartFactory.setChartTheme(chartTheme);
//设置标题
        chart.setTitle(new TextTitle(chartTitle, new Font(/*"黑体"*/fontsName, Font.ITALIC, 22)));
        LegendTitle legend = chart.getLegend();
        legend.setItemFont(new Font(fontsName, Font.BOLD, 12)); // 设置图例的字体,防止中文乱z码
        XYPlot xyplot = chart.getXYPlot();
//    xyplot.setBackgroundPaint(new Color(250, 250,250));
        xyplot.setBackgroundPaint(Color.white);
//    xyplot.setForegroundAlpha(0.65F); // 设置前景色透明度
        xyplot.setForegroundAlpha(1.0F); // 设置前景色透明度
        // 设置横虚线可见
        xyplot.setRangeGridlinesVisible(true);
        // 虚线色彩
        xyplot.setRangeGridlinePaint(Color.gray);
        xyplot.getRangeAxis().setLabelFont(new Font(fontsName, Font.BOLD, 12)); // Y轴设置字体,防止中文乱码
        xyplot.getDomainAxis().setLabelFont(new Font(fontsName, Font.BOLD, 12)); // X轴设置字体,防止中文乱码

        //边框 不显示
        xyplot.setOutlineVisible(false);

        //获得 renderer 注意这里是XYLineAndShapeRenderer !!
        XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer) xyplot.getRenderer();
        xylineandshaperenderer.setShapesVisible(true); //数据点可见
        xylineandshaperenderer.setShapesFilled(true); //数据点被填充即不是空心点
        xylineandshaperenderer.setSeriesFillPaint(0, Color.GREEN); //数据点填充为红色
        xylineandshaperenderer.setSeriesPaint(0, Color.GREEN); //折线为绿色


        xylineandshaperenderer.setUseFillPaint(true); //应用

        ////设置Y轴间隔
        NumberAxis numAxis = (NumberAxis) xyplot.getRangeAxis();
        numAxis.setTickUnit(new NumberTickUnit(1));

        //边框是否显示


        //设置X轴间隔
        DateAxis dateaxis = (DateAxis) xyplot.getDomainAxis();
        if (periodType.equalsIgnoreCase("MONTH")) {
            dateaxis.setTickUnit(new DateTickUnit(DateTickUnitType.MONTH, dateInterval));
        } else if (periodType.equalsIgnoreCase("DAY")) {
            dateaxis.setTickUnit(new DateTickUnit(DateTickUnitType.DAY, dateInterval));
        } else if (periodType.equalsIgnoreCase("HOUR")) {
            dateaxis.setTickUnit(new DateTickUnit(DateTickUnitType.HOUR, dateInterval));
        }
        dateaxis.setDateFormatOverride(new SimpleDateFormat(timeFormat));
        return chart;
    }
 
开发者ID:glameyzhou,项目名称:scaffold,代码行数:56,代码来源:JFreeChartFactory.java


注:本文中的org.jfree.chart.renderer.xy.XYLineAndShapeRenderer.setShapesVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。