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


Java LineAndShapeRenderer.setSeriesFillPaint方法代碼示例

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


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

示例1: createLineChart

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
@Override
	protected JFreeChart createLineChart() throws JRException
	{
		JFreeChart jfreeChart = super.createLineChart();
		CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
		LineAndShapeRenderer lineRenderer = (LineAndShapeRenderer)categoryPlot.getRenderer();
		lineRenderer.setBaseStroke(new BasicStroke(2f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
//		Stroke stroke = new BasicStroke(2f, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);

		for (int i = 0; i < lineRenderer.getRowCount(); i++)
		{
			lineRenderer.setSeriesOutlinePaint(i, ChartThemesConstants.TRANSPARENT_PAINT);
			lineRenderer.setSeriesFillPaint(i, ChartThemesConstants.EYE_CANDY_SIXTIES_GRADIENT_PAINTS.get(i));
			lineRenderer.setSeriesPaint(i, ChartThemesConstants.EYE_CANDY_SIXTIES_GRADIENT_PAINTS.get(i));
			lineRenderer.setSeriesShapesVisible(i,true);
			//it isn't applied at the moment
			//lineRenderer.setSeriesStroke(i,stroke);
			
			//line3DRenderer.setSeriesLinesVisible(i,lineRenderer.getSeriesVisible(i));
		}
//		configureChart(jfreeChart, getPlot());
		return jfreeChart;
	}
 
開發者ID:TIBCOSoftware,項目名稱:jasperreports,代碼行數:24,代碼來源:EyeCandySixtiesChartTheme.java

示例2: formatSeries

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
protected void formatSeries(LineAndShapeRenderer renderer) {
    renderer.setBaseShapesVisible(true);
    renderer.setDrawOutlines(true);
    renderer.setUseFillPaint(true);
    renderer.setBaseStroke(new BasicStroke(2));
    
    int count = ((CategoryDataset) dataset).getRowCount();
    ColorGenerator colors = format.getColors();
    for(int i=0; i<count; i++) {
        Paint color = colors.nextColor();
        renderer.setSeriesPaint(i, color);
        renderer.setSeriesFillPaint(i, color);
    }
}
 
開發者ID:Depter,項目名稱:JRLib,代碼行數:15,代碼來源:AbstractLineChart.java

示例3: formatSeries

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
protected void formatSeries(LineAndShapeRenderer renderer) {
    renderer.setBaseShapesVisible(true);
    renderer.setDrawOutlines(true);
    renderer.setUseFillPaint(true);
    renderer.setBaseStroke(new BasicStroke(2));
    
    int count = ((CategoryDataset) dataset).getRowCount();
    ColorGenerator colors = format.getColors();
    for(int i=0; i<count; i++) {
        Color color = colors.nextColor();
        renderer.setSeriesPaint(i, color);
        renderer.setSeriesFillPaint(i, color);
    }
}
 
開發者ID:Depter,項目名稱:JRLib,代碼行數:15,代碼來源:AbstractLineChart.java

示例4: createPlotComponent

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
private Component createPlotComponent() {
    
    boolean legend = true;
    boolean tooltips = false;
    boolean urls = false;
    chart = ChartFactory.createLineChart(null, null, null, 
            dataSet, PlotOrientation.VERTICAL, legend, tooltips, urls);
    
    CategoryPlot plot = chart.getCategoryPlot();
    plot.setBackgroundPaint(Color.GRAY);
    plot.setRangeGridlinesVisible(true);
    plot.setDomainGridlinesVisible(true);
    plot.setRangeGridlinePaint(Color.WHITE);
    plot.setDomainGridlinePaint(Color.WHITE);
    
    NumberAxis axis = (NumberAxis) plot.getRangeAxis();
    axis.setAutoRangeIncludesZero(false);
    axis.setAutoRangeStickyZero(true);
    
    renderer = plot.getRenderer();
    if(renderer instanceof LineAndShapeRenderer) {
        LineAndShapeRenderer lasr = (LineAndShapeRenderer) renderer;
        lasr.setBaseShapesVisible(true);
        lasr.setDrawOutlines(true);
        lasr.setUseFillPaint(true);
        lasr.setBaseStroke(new BasicStroke(2));

        ColorGenerator colors = new DefaultColorGenerator();
        int count = dataSet.getRowCount();
        
        int r = 3;
        Shape circle = new Ellipse2D.Float(-r, -r, 2*r, 2*r);
        for(int i=0; i<count; i++) {
            Paint color = colors.nextColor();
            lasr.setSeriesPaint(i, color);
            lasr.setSeriesFillPaint(i, color);
            lasr.setSeriesShape(i, circle);
        }
    
    }
    
    return new ChartPanel(chart);
}
 
開發者ID:Depter,項目名稱:JRLib,代碼行數:44,代碼來源:AccidentFactorPlot.java

示例5: createPlotComponent

import org.jfree.chart.renderer.category.LineAndShapeRenderer; //導入方法依賴的package包/類
private Component createPlotComponent() {
    
    boolean legend = true;
    boolean tooltips = false;
    boolean urls = false;
    chart = ChartFactory.createLineChart(null, null, null, 
            dataSet, PlotOrientation.VERTICAL, legend, tooltips, urls);
    
    CategoryPlot plot = chart.getCategoryPlot();
    plot.setBackgroundPaint(Color.GRAY);
    plot.setRangeGridlinesVisible(true);
    plot.setDomainGridlinesVisible(true);
    plot.setRangeGridlinePaint(Color.WHITE);
    plot.setDomainGridlinePaint(Color.WHITE);
    
    NumberAxis axis = (NumberAxis) plot.getRangeAxis();
    axis.setAutoRangeIncludesZero(false);
    axis.setAutoRangeStickyZero(true);
    
    renderer = plot.getRenderer();
    if(renderer instanceof LineAndShapeRenderer) {
        LineAndShapeRenderer lasr = (LineAndShapeRenderer) renderer;
        lasr.setBaseShapesVisible(true);
        lasr.setDrawOutlines(true);
        lasr.setUseFillPaint(true);
        lasr.setBaseStroke(new BasicStroke(2));

        
        int r = 3;
        Shape circle = new Ellipse2D.Float(-r, -r, 2*r, 2*r);
        int count = dataSet.getRowCount();
        for(int i=0; i<count; i++) {
            PlotLabel label = (PlotLabel) dataSet.getRowKey(i);
            boolean isLr = label.getId() >= developments;
            
            Color color = isLr? LINK_RATIO : FACTOR;
            lasr.setSeriesPaint(i, color);
            lasr.setSeriesFillPaint(i, color);
            lasr.setSeriesShape(i, circle);
            
            lasr.setSeriesShapesVisible(i, !isLr);
            lasr.setSeriesLinesVisible(i, isLr);
        }
    }
    
    return new ChartPanel(chart);
}
 
開發者ID:Depter,項目名稱:JRLib,代碼行數:48,代碼來源:DevelopmentFactorPlot.java


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