Examples of LineAndShapeRenderer


Examples of org.jfree.chart.renderer.LineAndShapeRenderer

* Post processor which is used to add shapes to the datapoints of a line graph.
*/
public class CategoryPostProcessor implements ChartPostProcessor {
    public void processChart(Object chart, Map params) {
        CategoryPlot plot = (CategoryPlot)((JFreeChart)chart).getPlot();
        plot.setRenderer(new LineAndShapeRenderer());
    }
View Full Code Here

Examples of org.jfree.chart.renderer.category.LineAndShapeRenderer

      final CategoryAxis catAxis = new CategoryAxis("Category");// NON-NLS
      final NumberAxis barsAxis = new NumberAxis("Value");// NON-NLS
      final NumberAxis linesAxis = new NumberAxis("Value2");// NON-NLS

      final CategoryPlot plot = new CategoryPlot(createDataset(), catAxis, barsAxis, new BarRenderer());
      plot.setRenderer(1, new LineAndShapeRenderer());

      // add lines dataset and axis to plot
      plot.setDataset(1, createDataset());
      plot.setRangeAxis(1, linesAxis);
View Full Code Here

Examples of org.jfree.chart.renderer.category.LineAndShapeRenderer

    {
      lineRenderer = new LineRenderer3D();
    }
    else
    {
      lineRenderer = new LineAndShapeRenderer();
    }

    //add lines dataset and axis to plot
    if (linesDataset != null)
    {
View Full Code Here

Examples of org.jfree.chart.renderer.category.LineAndShapeRenderer

          linesAxis.setUpperBound(getLineRangeMaximum());
        }
      }
    }

    final LineAndShapeRenderer linesRenderer = (LineAndShapeRenderer) plot.getRenderer(1);
    if (linesRenderer != null)
    {
      //set stroke with line width
      linesRenderer.setStroke(translateLineStyle(lineWidth, lineStyle));
      //hide shapes on line
      linesRenderer.setShapesVisible(isMarkersVisible());
      linesRenderer.setBaseShapesFilled(isMarkersVisible());

      //set colors for each line
      for (int i = 0; i < lineSeriesColor.size(); i++)
      {
        final String s = (String) lineSeriesColor.get(i);
        linesRenderer.setSeriesPaint(i, parseColorFromString(s));
      }
    }
  }
View Full Code Here

Examples of org.jfree.chart.renderer.category.LineAndShapeRenderer

    final CategoryPlot cpl = chart.getCategoryPlot();
    final CategoryItemRenderer renderer = cpl.getRenderer();
    renderer.setStroke(translateLineStyle(lineWidth, lineStyle));
    if (renderer instanceof LineAndShapeRenderer)
    {
      final LineAndShapeRenderer shapeRenderer = (LineAndShapeRenderer) renderer;
      shapeRenderer.setShapesVisible(isMarkersVisible());
      shapeRenderer.setBaseShapesFilled(isMarkersVisible());
    }

  }
View Full Code Here

Examples of org.jfree.chart.renderer.category.LineAndShapeRenderer

    configureChart(jfreeChart);

    CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
    JRLinePlot linePlot = (JRLinePlot)getPlot();

    LineAndShapeRenderer lineRenderer = (LineAndShapeRenderer)categoryPlot.getRenderer();
    boolean isShowShapes = linePlot.getShowShapes() == null ? true : linePlot.getShowShapes().booleanValue();
    boolean isShowLines = linePlot.getShowLines() == null ? true : linePlot.getShowLines().booleanValue();
   
    lineRenderer.setBaseShapesVisible( isShowShapes );//FIXMECHART check this
    lineRenderer.setBaseLinesVisible( isShowLines );
   
    //FIXME labels?

    // Handle the axis formating for the category axis
    configureAxis(categoryPlot.getDomainAxis(), linePlot.getCategoryAxisLabelFont(),
View Full Code Here

Examples of org.jfree.chart.renderer.category.LineAndShapeRenderer

    configureChart(freeChart, getPlot());

    CategoryPlot categoryPlot = (CategoryPlot)freeChart.getPlot();
    JRLinePlot linePlot = (JRLinePlot)getPlot();

    LineAndShapeRenderer lineRenderer = (LineAndShapeRenderer)categoryPlot.getRenderer();
    boolean isShowShapes = linePlot.getShowShapes() == null ? true : linePlot.getShowShapes().booleanValue();
    boolean isShowLines = linePlot.getShowLines() == null ? true : linePlot.getShowLines().booleanValue();
   
    lineRenderer.setBaseShapesVisible( isShowShapes );//FIXMECHART check this
    lineRenderer.setBaseLinesVisible( isShowLines );
   
    //FIXME labels?

    // Handle the axis formating for the category axis
    configureAxis(categoryPlot.getDomainAxis(), linePlot.getCategoryAxisLabelFont(),
View Full Code Here

Examples of org.jfree.chart.renderer.category.LineAndShapeRenderer

    configureChart(freeChart, getPlot());

    CategoryPlot categoryPlot = (CategoryPlot)freeChart.getPlot();
    JRLinePlot linePlot = (JRLinePlot)getPlot();

    LineAndShapeRenderer lineRenderer = (LineAndShapeRenderer)categoryPlot.getRenderer();
    boolean isShowShapes = linePlot.getShowShapes() == null ? true : linePlot.getShowShapes().booleanValue();
    boolean isShowLines = linePlot.getShowLines() == null ? true : linePlot.getShowLines().booleanValue();
   
    lineRenderer.setBaseShapesVisible( isShowShapes );//FIXMECHART check this
    lineRenderer.setBaseLinesVisible( isShowLines );
   
    //FIXME labels?

    // Handle the axis formating for the category axis
    configureAxis(categoryPlot.getDomainAxis(), linePlot.getCategoryAxisLabelFont(),
View Full Code Here

Examples of org.jfree.chart.renderer.category.LineAndShapeRenderer

   */
  protected JFreeChart createLineChart() throws JRException
  {
    JFreeChart jfreeChart = super.createLineChart();
    CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot();
    LineAndShapeRenderer lineRenderer = (LineAndShapeRenderer)categoryPlot.getRenderer();
    lineRenderer.setStroke(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, (Paint)ChartThemesConstants.EYE_CANDY_SIXTIES_GRADIENT_PAINTS.get(i));
      lineRenderer.setSeriesPaint(i, (Paint)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));
    }
View Full Code Here

Examples of org.jfree.chart.renderer.category.LineAndShapeRenderer

            plot.setBackgroundPaint(Color.WHITE);
            plot.setOutlinePaint(null);
            plot.setRangeGridlinesVisible(true);
            plot.setRangeGridlinePaint(Color.black);

            final LineAndShapeRenderer renderer = (LineAndShapeRenderer) plot.getRenderer();
            renderer.setBaseStroke(new BasicStroke(3));

            for (int i = 0; i < series.size(); i++)
                renderer.setSeriesPaint(i, series.get(i).color);

            final CategoryAxis domainAxis = new NoOverlapCategoryAxis(null);
            plot.setDomainAxis(domainAxis);
            domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
            domainAxis.setLowerMargin(0.0);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.