Package org.jfree.chart.plot

Examples of org.jfree.chart.plot.XYPlot


     * @param isShapeVisible if true, markers are visible.
     */
    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


     * lines in the same order as they were added to chart. Use jPlot.LAST_IDX
     * 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

    public void setLineStyle(int lineIndex,
                             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
View Full Code Here

        }
    }


    private NumberAxis getAxis(AxisEnum axis) {
        XYPlot plot = m_chart.getXYPlot();
        switch (axis) {
        case X:
            return (NumberAxis)plot.getDomainAxis();
        case Y:
            return (NumberAxis)plot.getRangeAxis();
        }
        return null; // should never happen
    }
View Full Code Here

                                                                   y,
                                                                   -angle * Math.PI / 180);
        m_xyAnnotation.setLabelOffset(m_xyAnnotation.getLabelOffset() * 2 + 10);

        if (m_chart != null) {
            XYPlot plot = m_chart.getXYPlot();
            plot.addAnnotation(m_xyAnnotation);
        }
    }
View Full Code Here

        NumberAxis xAxis = new NumberAxis("Time millis spend");
        xAxis.setNumberFormatOverride(new MillisecondsSpendNumberFormat());
        NumberAxis yAxis = new NumberAxis("Score");
        yAxis.setAutoRangeIncludesZero(false);
        XYItemRenderer renderer = new XYStepRenderer();
        XYPlot plot = new XYPlot(seriesCollection, xAxis, yAxis, renderer);
        plot.setOrientation(PlotOrientation.VERTICAL);
        JFreeChart chart = new JFreeChart(baseName + " best score statistic",
                JFreeChart.DEFAULT_TITLE_FONT, plot, true);
        BufferedImage chartImage = chart.createBufferedImage(1024, 768);
        File graphStatisticFile = new File(solverStatisticFilesDirectory, baseName + "Statistic.png");
        OutputStream out = null;
View Full Code Here

                                                          dataSet,
                                                          PlotOrientation.VERTICAL,
                                                          true,
                                                          false,
                                                          false);
        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();
            renderer.setBaseShapesVisible(false);
            plot.setRenderer(renderer);
        }

        chartPanel.setChart(chart);
    }
View Full Code Here

                true,
                false);

        chart.setBackgroundPaint(Color.white);

        XYPlot plot = (XYPlot) chart.getPlot();
        plot.setBackgroundPaint(Color.lightGray);
        plot.setDomainGridlinePaint(Color.white);
        plot.setRangeGridlinePaint(Color.white);
        plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
        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));

        NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
        NumberFormat numberformat = NumberFormat.getInstance();
        numberformat.setMaximumFractionDigits(0);
        numberformat.setMinimumFractionDigits(0);
        rangeAxis.setNumberFormatOverride(numberformat);
View Full Code Here

    JFreeChart chart = ChartFactory.createTimeSeriesChart(title, "Date",
        legend, dataset, true, true, false);

    chart.setBackgroundPaint(Color.white);

    XYPlot plot = (XYPlot) chart.getPlot();
    plot.setBackgroundPaint(Color.lightGray);
    plot.setDomainGridlinePaint(Color.white);
    plot.setRangeGridlinePaint(Color.white);
    plot.setAxisOffset(new RectangleInsets(0.5, 0.5, 0.5, 0.5));
    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));

    return chart;
  }
View Full Code Here

        series.add(6, 15);
        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);

        JFreeChart c = new JFreeChart(plot2);

        return new JFreeChartWrapper(c);
    }
View Full Code Here

TOP

Related Classes of org.jfree.chart.plot.XYPlot

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.