Package org.jfree.chart.renderer.xy

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


        plot.setRangeGridlinePaint(Color.white);
        plot.setAxisOffset(new RectangleInsets(2.0, 2.0, 2.0, 2.0));
        // Set series line styles
        plot.setRenderer(new XYStepRenderer());

        XYItemRenderer r = plot.getRenderer();
        if (r instanceof XYLineAndShapeRenderer) {
            XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r;
            renderer.setShapesVisible(true);
            renderer.setShapesFilled(true);
        }
View Full Code Here


    }

    private static JFreeChart createChart(XYDataset xydataset) {
        JFreeChart jfreechart = ChartFactory.createTimeSeriesChart("Time Series Demo 8", "Date", "Value", xydataset, true, true, false);
        XYPlot xyplot = (XYPlot) jfreechart.getPlot();
        XYItemRenderer xyitemrenderer = xyplot.getRenderer();
        StandardXYToolTipGenerator standardxytooltipgenerator = new StandardXYToolTipGenerator("{0}: ({1}, {2})", new SimpleDateFormat("d-MMM-yyyy"), new DecimalFormat("0.00"));
        xyitemrenderer.setBaseToolTipGenerator(standardxytooltipgenerator);
        return jfreechart;
    }
View Full Code Here

        plot.setRangeGridlinePaint(Color.white);

        // plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
        // plot.getRangeAxis().setFixedDimension(15.0);

        XYItemRenderer renderer = plot.getRenderer();
        renderer.setSeriesPaint(0, Color.green);

        // Mail
        NumberAxis axis2 = new NumberAxis("Scala Mail");
        axis2.setFixedDimension(10.0);
        axis2.setAutoRangeIncludesZero(false);
        axis2.setLabelPaint(Color.red);
        axis2.setTickLabelPaint(Color.red);
        plot.setRangeAxis(1, axis2);
        plot.setRangeAxisLocation(1, AxisLocation.BOTTOM_OR_LEFT);

        XYDataset dataset2 = createDataset("Mail", 1000.0, new Day(), 170);
        plot.setDataset(1, dataset2);
        plot.mapDatasetToRangeAxis(1, 1);

        XYItemRenderer renderer2 = new StandardXYItemRenderer();
        renderer2.setSeriesPaint(0, Color.red);
        plot.setRenderer(1, renderer2);

        // Sms
        NumberAxis axis3 = new NumberAxis("Scala Sms");
        axis3.setLabelPaint(Color.blue);
        axis3.setTickLabelPaint(Color.blue);
        plot.setRangeAxis(2, axis3);

        XYDataset dataset3 = createDataset("Sms", 10000.0, new Day(), 170);
        plot.setDataset(2, dataset3);
        plot.mapDatasetToRangeAxis(2, 2);

        XYItemRenderer renderer3 = new StandardXYItemRenderer();
        renderer3.setSeriesPaint(0, Color.blue);
        plot.setRenderer(2, renderer3);

        return chart;
    }
View Full Code Here

  void display(String windowTitle) {
    //     Create plot and show it
    JFreeChart chart = ChartFactory.createXYLineChart(chartTitle, "No. of Fuzzy Inference Cycles", "Time (ms)", xyDataset, PlotOrientation.VERTICAL, true, true, true);
    chart.setBackgroundPaint(Color.white);
    final XYPlot xyPlot = chart.getXYPlot();
    final XYItemRenderer renderer = xyPlot.getRenderer();

    if( renderer instanceof XYLineAndShapeRenderer ) {
      final XYLineAndShapeRenderer rr = (XYLineAndShapeRenderer) renderer;
      //rr.setShapesVisible(true);
      rr.setDefaultShapesFilled(false);
View Full Code Here

            throw new IllegalArgumentException("Null 'orientation' argument.");
        }
        NumberAxis xAxis = new NumberAxis(xAxisLabel);
        xAxis.setAutoRangeIncludesZero(false);
        NumberAxis yAxis = new NumberAxis(yAxisLabel);
        XYItemRenderer renderer = new XYSplineRenderer(10);
        XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
        plot.setOrientation(orientation);
        if (tooltips) {
            renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
        }
        if (urls) {
            renderer.setURLGenerator(new StandardXYURLGenerator());
        }

        JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, showLegend);
        ChartFactory.getChartTheme().apply(chart);
        return chart;
View Full Code Here

        XYURLGenerator urlGenerator = null;
        if (urls) {
            urlGenerator = new StandardXYURLGenerator();
        }
        XYItemRenderer renderer = new XYConditionRenderer(false, true);
        renderer.setBaseToolTipGenerator(toolTipGenerator);
        renderer.setURLGenerator(urlGenerator);
        plot.setRenderer(renderer);
        plot.setOrientation(orientation);

        JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
        ChartFactory.getChartTheme().apply(chart);
View Full Code Here

            throw new IllegalArgumentException("Null 'orientation' argument.");
        }
        NumberAxis xAxis = new NumberAxis(xAxisLabel);
        xAxis.setAutoRangeIncludesZero(false);
        NumberAxis yAxis = new NumberAxis(yAxisLabel);
        XYItemRenderer renderer = new XYConditionRenderer(true, false);
        XYPlot plot = new XYPlot(dataset, xAxis, yAxis, renderer);
        plot.setOrientation(orientation);
        if (tooltips) {
            renderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
        }
        if (urls) {
            renderer.setURLGenerator(new StandardXYURLGenerator());
        }

        JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend);
        ChartFactory.getChartTheme().apply(chart);
        return chart;
View Full Code Here

          PlotDefinition subPlotDef = (PlotDefinition) plotDefinitions.get(plotidx);
          check(subPlotDef.getDataset(), XYDataset.class, chartType);
          plot.setDataset(plotidx, (XYDataset)subPlotDef.getDataset());

          int rendererIndex = PlotTypes.getRendererIndex(subPlotDef.getType());
          XYItemRenderer rend = (XYItemRenderer) PlotTypes.getRenderer(rendererIndex);
          plot.setRenderer(plotidx, rend);
        }
        return new JFreeChart(title, new Font("SansSerif", Font.BOLD, 18), plot, showLegend);
      case OVERLAY_CATEGORY ://added by lrh 2005-07-11
        CategoryAxis domainAxis2 = (CategoryAxis)axisFactory.createAxis(ORIENTATION_HORIZONTAL, xAxisType, xAxisLabel);
View Full Code Here

                           new float[] {1.0f, 1.0f}, // Dash pattern
                           0.0f);                     // Dash phase


        // Setup legend an plotting colors
        XYItemRenderer renderer = plot.getRenderer();
        renderer.setBaseToolTipGenerator(null);
        int numseries = renderer.getPlot().getSeriesCount();
        int i = 0;

        for (i = 0; i < numseries; i += 4) {
            renderer.setSeriesPaint((i + 0), Color.BLACK);
            renderer.setSeriesPaint((i + 1), Color.BLUE);
            renderer.setSeriesPaint((i + 2), Color.RED);
            renderer.setSeriesPaint((i + 3), Color.MAGENTA);
        }

        // Turn on and off traces (real, imag, etc)
        updateTraceVisibility();


        // Modify values for specific themes:
        switch (this.currentDisplayTheme) {
            case PALOALTO:

                plot.setBackgroundPaint(Color.BLACK);

                xaxis.setAxisLinePaint(Color.WHITE);
                xaxis.setTickMarkPaint(Color.WHITE);
                xaxis.setTickLabelPaint(Color.WHITE);           
                xaxis.setLabelPaint(Color.WHITE);
               
                yaxis.setAxisLinePaint(Color.WHITE);
                yaxis.setTickMarkPaint(Color.white);
                yaxis.setTickLabelPaint(Color.WHITE);           
                yaxis.setLabelPaint(Color.WHITE);
               
                // Turn off the y-labels. Keep visible (otherwise the zooming
                //  is disabled) but make the font black and very small:
                yaxis.setMinorTickCount(0);
                yaxis.setTickLabelPaint(Color.BLACK);
                Font yfont = yaxis.getTickLabelFont();
                yaxis.setTickLabelFont(new Font(yfont.getName(), yfont.getStyle(), 6) );

                this.jFreeChart.setBackgroundPaint(Color.BLACK);

                for (i = 0; i < numseries; i += 4) {
                    renderer.setSeriesPaint((i + 0), Color.CYAN);
                    renderer.setSeriesPaint((i + 1), Color.MAGENTA);
                    renderer.setSeriesPaint((i + 2), Color.CYAN);
                    renderer.setSeriesPaint((i + 3), Color.MAGENTA);
                }

                // Markers
                pointMarker.setPaint(Color.red);
                regionMarker.setPaint(Color.black);
                regionMarkerLow.setPaint(Color.red);
                regionMarkerHigh.setPaint(Color.red);


                break;

            case ERLANGEN:
                plot.setBackgroundPaint(Color.BLACK);

                xaxis.setAxisLinePaint(Color.WHITE);
                xaxis.setTickMarkPaint(Color.WHITE);
                xaxis.setTickLabelPaint(Color.WHITE);           
                xaxis.setLabelPaint(Color.WHITE);
               
                yaxis.setAxisLinePaint(Color.WHITE);
                yaxis.setTickMarkPaint(Color.white);
                yaxis.setTickLabelPaint(Color.WHITE);           
                yaxis.setLabelPaint(Color.WHITE);

                this.jFreeChart.setBackgroundPaint(Color.BLACK);

                for (i = 0; i < numseries; i += 4) {
                    renderer.setSeriesPaint((i + 0), Color.WHITE);
                    renderer.setSeriesPaint((i + 1), Color.WHITE);
                    renderer.setSeriesPaint((i + 2), Color.WHITE);
                    renderer.setSeriesPaint((i + 3), Color.WHITE);
                }

                // Markers
                pointMarker.setPaint(Color.yellow);
                regionMarker.setPaint(Color.black);
View Full Code Here

        timeSeries.add(new Millisecond(endTime.usec / 1000, endTime.second, endTime.minute, endTime.hour, endTime.date, endTime.month, endTime.year), 1000);
        addSeries(timeSeries);
    }

    public void setupPlot(XYPlot plot) {
        XYItemRenderer renderer = plot.getRenderer();
        renderer.setSeriesVisible(0, false);
    }
View Full Code Here

TOP

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

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.