Package org.jfree.chart.renderer.xy

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


                    list.add(data.getV()[i].get(j, k));
                }
            }
            listSeries.add(list);
            ChartPanel chartPanel = XYChart.createChart(listSeries, ("" + (i + 1) + " (" + num + "%)"), seriesTitle, "", true);
            final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
            final XYPlot plot = chartPanel.getChart().getXYPlot();
            renderer.setSeriesShapesVisible(0, false);
            plot.setRenderer(renderer);
            NumberAxis rangeAxisVec = (NumberAxis) plot.getRangeAxis();
            rangeAxisVec.setRange((Double) Collections.min(list), (Double) Collections.max(list));
            charts.add(chartPanel);
        }
View Full Code Here


        listSeries.add(data.getTimeSeries());
        listSeries.add(data.getReconstructionList());
        seriesTitle.add("Исходный");
        seriesTitle.add("Восстановленный");
        ChartPanel reconstructionChart = XYChart.createChart(listSeries, "Исходный и восстановленный ряд", seriesTitle, "", true);
        final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
        final XYPlot plot = reconstructionChart.getChart().getXYPlot();
        renderer.setSeriesShapesVisible(0, false);
        renderer.setSeriesShapesVisible(1, false);
        plot.setRenderer(renderer);
        reconstructionFrame = InternalFrame.createInternalFrame(reconstructionChart, "Исходный и восстановленный ряд");
        reconstructionFrame.setName("reconstruction");
        desctop.add(reconstructionFrame);
        FrameParams.setInternalFrameParams(reconstructionFrame, desctop, data);
View Full Code Here

    private void createChart()
    {
        // Create the chart:
        collection = new XYSeriesCollection();
        XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true,false);

        xySeries = new XYSeries("Automation");
        collection.addSeries(xySeries);

        chart = ChartFactory.createXYLineChart(null,"Time","Value",collection,PlotOrientation.VERTICAL,false,false,false);
View Full Code Here

    plot.setBackgroundPaint(Color.lightGray);
    // plot.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 5.0, 5.0, 5.0, 5.0));
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);

    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
    renderer.setSeriesLinesVisible(0, true);
    renderer.setSeriesShapesVisible(1, false);
    plot.setRenderer(renderer);

    NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
    rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
View Full Code Here

    domain.setTickLabelFont(new Font("SansSerif", Font.PLAIN, 12));
    range.setTickLabelFont(new Font("SansSerif", Font.PLAIN, 12));
    domain.setLabelFont(new Font("SansSerif", Font.PLAIN, 14));
    range.setLabelFont(new Font("SansSerif", Font.PLAIN, 14));
               
    XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false);
               
              
               
    renderer.setSeriesPaint(0, Color.red);
    renderer.setSeriesPaint(1, Color.green);
                renderer.setSeriesPaint(2, Color.blue);
                renderer.setSeriesPaint(3, Color.black);
               
    renderer.setStroke(new BasicStroke(3f, BasicStroke.CAP_BUTT,
        BasicStroke.JOIN_BEVEL));
    XYPlot plot = new XYPlot(dataset, domain, range, renderer);
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
View Full Code Here

        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 SimpleDateFormat("MMM-yyyy"));
View Full Code Here

     */
    private static JFreeChart createCombinedChart() {

        // create plot ...
        IntervalXYDataset data1 = createDataset1();
        XYItemRenderer renderer1 = new XYLineAndShapeRenderer(true, false);
        renderer1.setBaseToolTipGenerator(new StandardXYToolTipGenerator(
                StandardXYToolTipGenerator.DEFAULT_TOOL_TIP_FORMAT,
                new SimpleDateFormat("d-MMM-yyyy"), new DecimalFormat("0.00")));
        renderer1.setSeriesStroke(0, new BasicStroke(4.0f,
                BasicStroke.CAP_ROUND, BasicStroke.JOIN_BEVEL));
        renderer1.setSeriesPaint(0, Color.blue);

        DateAxis domainAxis = new DateAxis("Year");
        domainAxis.setLowerMargin(0.0);
        domainAxis.setUpperMargin(0.02);
        ValueAxis rangeAxis = new NumberAxis("$billion");
View Full Code Here

        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 SimpleDateFormat("MMM-yyyy"));
View Full Code Here

            true,
            false
        );
        // some additional chart customisation here...
        XYPlot plot = chart.getXYPlot();
        XYLineAndShapeRenderer renderer
        = (XYLineAndShapeRenderer) plot.getRenderer();
        renderer.setShapesVisible(true);
        DateAxis axis = (DateAxis) plot.getDomainAxis();
        axis.setDateFormatOverride(new SimpleDateFormat("MMM-yyyy"));
        // write the chart to a PDF file...
        File fileName = new File("jfreechart1.pdf");
        saveChartAsPDF(fileName, chart, 400, 300, new DefaultFontMapper());
View Full Code Here

    /**
     * Tests cloning to ensure that the cloned plot is registered as a listener
     * on the cloned renderer.
     */
    public void testCloning4() {
        XYLineAndShapeRenderer r1 = new XYLineAndShapeRenderer();
        XYPlot p1 = new XYPlot(null, new NumberAxis("Domain Axis"),
                new NumberAxis("Range Axis"), r1);
        XYPlot p2 = null;
        try {
            p2 = (XYPlot) p1.clone();
        }
        catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        assertTrue(p1 != p2);
        assertTrue(p1.getClass() == p2.getClass());
        assertTrue(p1.equals(p2));

        // verify that the plot is listening to the cloned renderer
        XYLineAndShapeRenderer r2 = (XYLineAndShapeRenderer) p2.getRenderer();
        assertTrue(r2.hasListener(p2));
    }
View Full Code Here

TOP

Related Classes of org.jfree.chart.renderer.xy.XYLineAndShapeRenderer

Copyright © 2018 www.massapicom. 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.