Examples of XYLineAndShapeRenderer


Examples of org.jfree.chart.renderer.xy.XYLineAndShapeRenderer

    XYPlot plot = new XYPlot();
    plot.setBackgroundPaint(Color.LIGHT_GRAY);
    plot.setRangeGridlinePaint(Color.LIGHT_GRAY);
    plot.setDomainGridlinePaint(Color.LIGHT_GRAY);
   
    XYLineAndShapeRenderer problemRenderer = getProblemRenderer(problem);
    plot.setDataset(0, problem);
    plot.setRenderer(0, problemRenderer);

    XYItemRenderer shipmentsRenderer = getShipmentRenderer(shipments);
    plot.setDataset(1, shipments);
View Full Code Here

Examples of org.jfree.chart.renderer.xy.XYLineAndShapeRenderer

   
    return plot;
  }

  private XYItemRenderer getRouteRenderer(XYSeriesCollection solutionColl) {
    XYItemRenderer solutionRenderer = new XYLineAndShapeRenderer(true, false);   // Lines only
    for(int i=0;i<solutionColl.getSeriesCount();i++){
      XYSeries s = solutionColl.getSeries(i);
      XYDataItem firstCustomer = s.getDataItem(1);
      firstActivities.add(firstCustomer);
    }
View Full Code Here

Examples of org.jfree.chart.renderer.xy.XYLineAndShapeRenderer

     */
    public void setLineVisibility(int lineIndex,
                                  boolean isLineVisible,
                                  boolean isShapeVisible) {
        XYPlot plot = m_chart.getXYPlot();
        XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer();
       
        lineIndex = getLastIndex(lineIndex);
        renderer.setSeriesLinesVisible(lineIndex, isLineVisible);
        renderer.setSeriesShapesVisible(lineIndex, isShapeVisible);
    }
View Full Code Here

Examples of org.jfree.chart.renderer.xy.XYLineAndShapeRenderer

     * to refer to the last line added.
     * @param linePaint for example: Paint paint = Color.magenta;
     */
    public void setLineColor(int lineIndex, Paint linePaint) {
        XYPlot plot = m_chart.getXYPlot();
        XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer();

        renderer.setSeriesPaint(getLastIndex(lineIndex), linePaint);
    }
View Full Code Here

Examples of org.jfree.chart.renderer.xy.XYLineAndShapeRenderer

                             Shape marker,
                             int lineWidth,
                             float[] style) {

        XYPlot plot = m_chart.getXYPlot();
        XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer();

        lineIndex = getLastIndex(lineIndex);
        if (marker != null) {
            renderer.setSeriesShape(lineIndex, marker);
            if (style == null) { // no line, draw only markers
                /* float dashPhase = 0;
                Stroke stroke = new BasicStroke(lineWidth,
                                                BasicStroke.CAP_ROUND,
                                                BasicStroke.JOIN_ROUND,
                                                2,
                                                null,
                                                dashPhase);
                renderer.setSeriesStroke(lineIndex, stroke);
                */
                setLineVisibility(lineIndex, false, true);
            } else {
                setLineVisibility(lineIndex, true, true); // show line and markers
            }
        }
       
        if (style != null) {
            float dashPhase = 0;
            Stroke stroke = new BasicStroke(lineWidth,
                                            BasicStroke.CAP_ROUND,
                                            BasicStroke.JOIN_ROUND,
                                            2,
                                            style,
                                            dashPhase);
            renderer.setSeriesStroke(lineIndex, stroke);
        }
    }
View Full Code Here

Examples of org.jfree.chart.renderer.xy.XYLineAndShapeRenderer

        XYPlot plot = (XYPlot) chart.getPlot();
        if (discrete)
        {
            // Render markers at each data point (these discrete points are the
            // distibution, not the lines between them).
            plot.setRenderer(new XYLineAndShapeRenderer());
        }
        else
        {
            // Render smooth lines between points for a continuous distribution.
            XYSplineRenderer renderer = new XYSplineRenderer();
View Full Code Here

Examples of org.jfree.chart.renderer.xy.XYLineAndShapeRenderer

        plot.setDomainCrosshairVisible(true);
        plot.setRangeCrosshairVisible(true);

        XYItemRenderer r = plot.getRenderer();
        if (r instanceof XYLineAndShapeRenderer) {
            XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
            renderer.setBaseShapesVisible(true);
            renderer.setBaseShapesFilled(true);
        }

        DateAxis axis = (DateAxis) plot.getDomainAxis();
        axis.setDateFormatOverride(new SimpleDateFormat(DATE_PATTERN));
View Full Code Here

Examples of org.jfree.chart.renderer.xy.XYLineAndShapeRenderer

    plot.setDomainCrosshairVisible(true);
    plot.setRangeCrosshairVisible(true);

    XYItemRenderer r = plot.getRenderer();
    if (r instanceof XYLineAndShapeRenderer) {
      XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
      renderer.setBaseShapesVisible(true);
      renderer.setBaseShapesFilled(true);
      renderer.setDrawSeriesLineAsPath(true);
    }

    DateAxis axis = (DateAxis) plot.getDomainAxis();
    axis.setDateFormatOverride(new java.text.SimpleDateFormat(dateFormat));
View Full Code Here

Examples of org.jfree.chart.renderer.xy.XYLineAndShapeRenderer

        ds2.addSeries(series);

        XYAreaRenderer r = new XYAreaRenderer(XYAreaRenderer.AREA_AND_SHAPES);

        XYPlot plot2 = new XYPlot(ds2, new NumberAxis("X"), y,
                new XYLineAndShapeRenderer());

        plot2.setDataset(1, ds);

        plot2.setRenderer(1, r);
View Full Code Here

Examples of org.jfree.chart.renderer.xy.XYLineAndShapeRenderer

        DefaultXYDataset ds2 = new DefaultXYDataset();
        ds2.addSeries("regline", new double[][] { new double[] { 1, 6 },
                new double[] { v1, v2 } });
        plot.setDataset(1, ds2);
        plot.setRenderer(1, new XYLineAndShapeRenderer(true, false));

        JFreeChart c = new JFreeChart(plot);

        return new JFreeChartWrapper(c);
    }
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.