當前位置: 首頁>>代碼示例>>Java>>正文


Java XYLineAndShapeRenderer.setBaseFillPaint方法代碼示例

本文整理匯總了Java中org.jfree.chart.renderer.xy.XYLineAndShapeRenderer.setBaseFillPaint方法的典型用法代碼示例。如果您正苦於以下問題:Java XYLineAndShapeRenderer.setBaseFillPaint方法的具體用法?Java XYLineAndShapeRenderer.setBaseFillPaint怎麽用?Java XYLineAndShapeRenderer.setBaseFillPaint使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jfree.chart.renderer.xy.XYLineAndShapeRenderer的用法示例。


在下文中一共展示了XYLineAndShapeRenderer.setBaseFillPaint方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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;
}
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:33,代碼來源:ChartGenerator_JTable.java

示例2: 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;
    }
 
開發者ID:SOCR,項目名稱:HTML5_WebSite,代碼行數:63,代碼來源:Chart.java


注:本文中的org.jfree.chart.renderer.xy.XYLineAndShapeRenderer.setBaseFillPaint方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。