Example usage for org.jfree.chart.plot XYPlot XYPlot

List of usage examples for org.jfree.chart.plot XYPlot XYPlot

Introduction

In this page you can find the example usage for org.jfree.chart.plot XYPlot XYPlot.

Prototype

public XYPlot() 

Source Link

Document

Creates a new XYPlot instance with no dataset, no axes and no renderer.

Usage

From source file:daylightchart.options.chart.BaseChartOptions.java

private static JFreeChart createDummyChart() {
    final JFreeChart chart = new JFreeChart(new XYPlot());
    chart.setTitle("");
    final XYPlot plot = chart.getXYPlot();
    plot.setDomainAxis(new DateAxis());
    plot.setRangeAxis(new DateAxis());
    return chart;
}

From source file:statistic.graph.XYChart.java

public XYChart(String title, String xAxisLabel, String yAxis, XYSeriesCollection collection, boolean linear) {
    super(title, JFreeChart.DEFAULT_TITLE_FONT, new XYPlot(), true);
    this.collection = collection;
    setBackgroundPaint(Color.WHITE);
    setTitle(title);/* w  ww.  j  av  a 2s .com*/
    plot = (XYPlot) getPlot();
    plot.setDataset(collection);
    if (linear) {
        plot.setRenderer(new DefaultXYItemRenderer());
    } else {
        plot.setRenderer(new XYStepRenderer());
    }
    plot.setOrientation(PlotOrientation.VERTICAL);
    initXAxis(xAxisLabel);
    plot.setRangeAxis(new NumberAxis(yAxis));
    plot.setBackgroundPaint(Color.LIGHT_GRAY);
    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);
}

From source file:org.sonar.server.charts.deprecated.SparkLinesChart.java

public SparkLinesChart(Map<String, String> params) {
    super(params);
    jfreechart = new JFreeChart(null, TextTitle.DEFAULT_FONT, new XYPlot(), false);
}

From source file:bzstats.chart.KillRatioHistoryChart.java

protected JFreeChart getChart() {

    DefaultTableXYDataset dataset = new DefaultTableXYDataset();

    fillDataset(dataset);/*from   w w  w .ja v a 2  s  . c om*/

    XYPlot plot = new XYPlot();

    NumberAxis xaxis = new NumberAxis("Time");
    xaxis.setTickLabelsVisible(false);
    NumberAxis yaxis = new NumberAxis("Killratio");

    plot.setDomainAxis(xaxis);
    plot.setRangeAxis(yaxis);
    plot.setDataset(dataset);
    plot.setRenderer(new StandardXYItemRenderer(StandardXYItemRenderer.LINES));

    JFreeChart chart = new JFreeChart("Killratio", JFreeChart.DEFAULT_TITLE_FONT, plot, true);

    chart.addSubtitle(new TextTitle("kills/deaths"));

    chart.setBackgroundPaint(Color.white);

    return chart;

}

From source file:AsymptoticFreedom.GraphViewPanel.java

public JFreeChart getResultChart() {
    // XY ?/* w  ww  . java 2  s.  c  om*/
    int quark_size = ViewPanel.quark_list.size();
    if (quark_size < 2)
        return new JFreeChart(new XYPlot());

    // XY Dataset  
    XYSeriesCollection data = new XYSeriesCollection();
    //System.out.println(series.get(0).getY(30));
    for (XYSeries s : series) {
        data.addSeries(s);
    }

    final JFreeChart chart = ChartFactory.createXYLineChart("Potential", "Distance", "Potential", data,
            PlotOrientation.VERTICAL, true, true, false);
    chart.setTitle("Potential of quarks"); //  ?
    XYPlot plot = (XYPlot) chart.getPlot();
    //plot.addRangeMarker(new ValueMarker(15,Color.RED,new BasicStroke(2.0f)));
    for (int i = 0; i < quark_size; i++) {
        for (int j = i + 1; j < quark_size; j++) {
            Quark quark1 = ViewPanel.quark_list.get(i);
            Quark quark2 = ViewPanel.quark_list.get(j);
            double distance = quark1.pos.distance(quark2.pos);
            double value = quark1.calculatePotential(quark2);
            String anno_title = String.format("V_ %c-%c", quark1.color.charAt(0), quark2.color.charAt(0));
            //System.out.println(anno_title);
            XYPointerAnnotation pointer = new XYPointerAnnotation(anno_title, distance, value,
                    3.0 * Math.PI / 4.0);
            plot.addAnnotation(pointer);
        }
    }
    plot.getRangeAxis().setRange(-500, 4000);
    return chart;
}

From source file:com.ivli.roim.controls.ChartView.java

protected void initChart() {
    if (null != iPlot) {
        ((XYSeriesCollection) iPlot.getDataset()).removeAllSeries();
    } else {//from  w  ww .  j a va2  s.  co m
        iPlot = new XYPlot();
        iPlot.setRenderer(new StandardXYItemRenderer());
        iPlot.setDomainAxis(new NumberAxis(java.util.ResourceBundle.getBundle("com/ivli/roim/Bundle")
                .getString("ROI_CHART.TIME_SERIES_VALUES")));
        iPlot.setRangeAxis(0, new NumberAxis(java.util.ResourceBundle.getBundle("com/ivli/roim/Bundle")
                .getString("ROI_CHART.ROI_INTDEN_VALUES")));
        iPlot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);
        iPlot.setDomainAxisLocation(AxisLocation.BOTTOM_OR_LEFT);

        iJfc = new JFreeChart(
                java.util.ResourceBundle.getBundle("com/ivli/roim/Bundle").getString("ROI_CHART.CHART_TITLE"),
                iPlot);

        iChart = new ChartControl(iJfc);

        iPlot.setDataset(new XYSeriesCollection());

        iChart.setPreferredSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));
        iChart.setMaximumSize(new Dimension(Short.MAX_VALUE, Short.MAX_VALUE));
        setLayout(new BorderLayout());

        this.add(iChart);
    }
    iChart.setMouseZoomable(false);
    iChart.setMouseWheelEnabled(true);
}

From source file:grafix.graficos.eixos.Eixo.java

public XYPlot getPlot(JanelaGraficos janela) {
    if (isVisible()) {
        XYPlot plot = new XYPlot();
        configurarPlot(plot);/*from w  w w.  j a v a 2s  . c  o m*/
        incluirIndices(plot, janela);
        incluirMarcas(plot, janela);
        completarPlot(plot, janela);
        return plot;
    }
    return null;
}

From source file:ec.nbdemetra.sa.revisionanalysis.RevisionAnalysisChart.java

private JFreeChart createChart() {
    XYPlot plot = new XYPlot();

    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true, false);
    renderer.setAutoPopulateSeriesPaint(false);
    renderer.setAutoPopulateSeriesStroke(false);
    renderer.setBaseStroke(TsCharts.getStrongStroke(ITsChart.LinesThickness.Thin));
    plot.setRenderer(renderer);//from w  w  w  .  j a  v a  2s .c  o  m

    JFreeChart result = new JFreeChart("", TsCharts.CHART_TITLE_FONT, plot, true);
    result.setPadding(TsCharts.CHART_PADDING);
    result.setTitle("Standard deviations");

    return result;
}

From source file:ec.nbdemetra.chainlinking.outlineview.ChainLinkingChart.java

private JFreeChart createChart() {
    XYPlot plot = new XYPlot();

    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true, false);
    renderer.setAutoPopulateSeriesPaint(false);
    renderer.setAutoPopulateSeriesStroke(false);
    renderer.setBaseStroke(TsCharts.getStrongStroke(ITsChart.LinesThickness.Thin));
    plot.setRenderer(renderer);//from  ww  w  .  jav a  2s.  c om

    JFreeChart r = new JFreeChart("", TsCharts.CHART_TITLE_FONT, plot, true);
    r.setPadding(TsCharts.CHART_PADDING);
    r.setTitle("Chain Linking");

    return r;
}

From source file:playground.benjamin.scenarios.zurich.analysis.charts.BkChartTemplate.java

public JFreeChart createChart() {
    XYPlot plot = new XYPlot();
    plot.setDataset(0, this.getDataset());
    JFreeChart chart = new JFreeChart("", plot);
    chart.setBackgroundPaint(ChartColor.WHITE);
    chart.setTextAntiAlias(true);//w  w  w .j  ava  2  s  . co m
    //    chart.removeLegend();
    return chart;
}