當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。