Example usage for org.jfree.chart.plot PlotOrientation VERTICAL

List of usage examples for org.jfree.chart.plot PlotOrientation VERTICAL

Introduction

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

Prototype

PlotOrientation VERTICAL

To view the source code for org.jfree.chart.plot PlotOrientation VERTICAL.

Click Source Link

Document

For a plot where the range axis is vertical.

Usage

From source file:views.SentimentGraph.java

public SentimentGraph(String applicationTitle, String chartTitle) throws ParseException {
    super(applicationTitle);
    JFreeChart lineChart = ChartFactory.createLineChart(chartTitle, "Date", "Polarity", createDataset(),
            PlotOrientation.VERTICAL, true, true, false);

    ChartPanel chartPanel = new ChartPanel(lineChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(1000, 367));
    JScrollPane pane = new JScrollPane();
    pane.add(chartPanel);/*  w w w .ja v a  2s . c  o  m*/
    setContentPane(chartPanel);

}

From source file:uom.research.thalassemia.util.LineChartCreator.java

/**
 * Create a Line Chart./* ww  w  .  ja v a2s .  co  m*/
 *
 * @param dataSet data set
 * @param chartTitle chart title
 * @param subTitle sub title
 * @param xTitle x axis title
 * @param yTitle y axis title
 * @return
 */
public JPanel createPanel(final DefaultCategoryDataset dataSet, final String chartTitle, final String subTitle,
        final String xTitle, final String yTitle) {
    JFreeChart lineChart = ChartFactory.createLineChart(chartTitle, xTitle, yTitle, dataSet,
            PlotOrientation.VERTICAL, true, true, false);

    ChartPanel chartPanel = new ChartPanel(lineChart);
    return chartPanel;
}

From source file:graficarfreechart.GraficarFreeChart.java

public GraficarFreeChart(String applicationTitle, String chartTitle) {
    super(applicationTitle);

    JFreeChart xylineChart = ChartFactory.createXYLineChart(chartTitle, "Category", "Score", dataset,
            PlotOrientation.VERTICAL, true, true, false);

    ChartPanel chartPanel = new ChartPanel(xylineChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    final XYPlot plot = xylineChart.getXYPlot();
    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
    renderer.setSeriesPaint(0, Color.RED);
    renderer.setSeriesPaint(1, Color.GREEN);
    renderer.setSeriesPaint(2, Color.YELLOW);
    renderer.setSeriesStroke(0, new BasicStroke(4.0f));
    renderer.setSeriesStroke(1, new BasicStroke(3.0f));
    renderer.setSeriesStroke(2, new BasicStroke(2.0f));
    plot.setRenderer(renderer);/*w  ww  .j a  va 2 s  .co  m*/
    setContentPane(chartPanel);
}

From source file:simulation.Graf.java

public Graf(String applicationTitle, String chartTitle, String chart, String chart2) {
    super(applicationTitle);
    JFreeChart lineChart = ChartFactory.createXYLineChart(chartTitle, chart, chart2, mnozina,
            PlotOrientation.VERTICAL, true, true, false);
    plot = (XYPlot) lineChart.getPlot();
    axis = (NumberAxis) plot.getRangeAxis();
    lineChart.getLegend().setVisible(false);
    lineChart.getLegend().setPosition(RectangleEdge.RIGHT);
    ChartPanel chartPanel = new ChartPanel(lineChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    p = chartPanel;//from w w w .  java2  s  .  c o  m
    setContentPane(chartPanel);
}

From source file:org.jfree.chart.demo.StackedXYAreaRendererDemo1.java

private static JFreeChart createChart(TableXYDataset tablexydataset) {
    JFreeChart jfreechart = ChartFactory.createStackedXYAreaChart("StackedXYAreaRendererDemo1", "X Value",
            "Y Value", tablexydataset, PlotOrientation.VERTICAL, true, true, false);
    XYPlot xyplot = (XYPlot) jfreechart.getPlot();
    StackedXYAreaRenderer stackedxyarearenderer = new StackedXYAreaRenderer(5);
    stackedxyarearenderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
    xyplot.setRenderer(0, stackedxyarearenderer);
    xyplot.setDomainCrosshairVisible(true);
    xyplot.setRangeCrosshairVisible(true);
    stackedxyarearenderer.setShapePaint(Color.yellow);
    ChartUtilities.applyCurrentTheme(jfreechart);
    return jfreechart;
}

From source file:Reportes.BarChart.java

public ChartPanel reporteEmpleados(DefaultCategoryDataset data) {
    JFreeChart JFchart = ChartFactory.createBarChart("Reporte de empleados", "Sedes", "Cantidad", data,
            PlotOrientation.VERTICAL, true, true, true);
    /*/*from   w ww.j  a v a2s  .c  o  m*/
    CategoryPlot plot = new CategoryPlot();
            
    ChartFrame chartFrame = new ChartFrame("Reporte de empleadoos", JFchart, false);
    chartFrame.setSize(300, 300);
    chartFrame.setVisible(true);
    */

    CategoryPlot categoryP = JFchart.getCategoryPlot();
    BarRenderer renderer = (BarRenderer) categoryP.getRenderer();
    renderer.setMaximumBarWidth(0.35);
    Color color = new Color(67, 165, 208);
    renderer.setSeriesPaint(0, color);

    ChartPanel panel = new ChartPanel(JFchart, true, true, true, false, false);

    panel.setSize(ancho, alto);

    return panel;
}

From source file:org.jfree.chart.demo.StackedBarDemo1.java

public StackedBarDemo1(String s) {
    super(s);/*  w w w.j av a 2 s. co m*/
    DefaultCategoryDataset defaultcategorydataset = new DefaultCategoryDataset();
    defaultcategorydataset.addValue(1.0D, "Row 1", "Column 1");
    defaultcategorydataset.addValue(5D, "Row 1", "Column 2");
    defaultcategorydataset.addValue(3D, "Row 1", "Column 3");
    defaultcategorydataset.addValue(2D, "Row 2", "Column 1");
    defaultcategorydataset.addValue(3D, "Row 2", "Column 2");
    defaultcategorydataset.addValue(2D, "Row 2", "Column 3");
    org.jfree.chart.JFreeChart jfreechart = ChartFactory.createStackedBarChart("StackedBarDemo1", "Category",
            "Value", defaultcategorydataset, PlotOrientation.VERTICAL, true, true, false);
    ChartPanel chartpanel = new ChartPanel(jfreechart, false);
    chartpanel.setPreferredSize(new Dimension(500, 270));
    setContentPane(chartpanel);
}

From source file:graph.GraphCreater.java

public GraphCreater(String applicationTitle, String chartTitle, ArrayList<String> resultList,
        ArrayList<String> dateList) {
    super(applicationTitle);
    JFreeChart lineChart = ChartFactory.createLineChart(chartTitle, "Testing date",
            "Sugar level - units(mg/dL)", createDataset(resultList, dateList), PlotOrientation.VERTICAL, true,
            true, false);//ww w  . j  a va2s  . c o m

    ChartPanel chartPanel = new ChartPanel(lineChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    setContentPane(chartPanel);
    final CategoryPlot plot = (CategoryPlot) lineChart.getPlot();
    CategoryAxis catAxis = plot.getDomainAxis();
    catAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);

}

From source file:Graphic.Poids.java

public Poids(List<Float> valeurs, List<String> date) {
    dataset = new XYSeriesCollection();
    XYSeries serie = new XYSeries("Courbe");
    for (int i = 0; i < valeurs.size(); i++) {
        serie.add(i, valeurs.get(i));//from w  w  w.  j a  v  a  2 s  . co m
    }
    dataset.addSeries(serie);
    diagramme = ChartFactory.createXYLineChart("Graphe de Poids", "Date", "Poids", dataset,
            PlotOrientation.VERTICAL, true, true, false);

    ChartPanel chartPanel = new ChartPanel(diagramme);
    chartPanel.setFillZoomRectangle(true);
    chartPanel.setMouseWheelEnabled(true);
    chartPanel.setPreferredSize(new Dimension(1200, 600));
    add(chartPanel);
}

From source file:GUI.Data.java

/**
 * Creates new form Data/*from   w ww .ja  va2  s  .c o m*/
 */
public Data() {

    XYSeries Goals = new XYSeries("Goals Scored");
    Goals.add(1, 1.0);
    Goals.add(2, 3.0);
    Goals.add(3, 2.0);
    Goals.add(4, 0.0);
    Goals.add(5, 3.0);
    XYDataset xyDataset = new XYSeriesCollection(Goals);
    JFreeChart chart = ChartFactory.createXYLineChart("Goals Scored Over Time", "Fixture Number", "Goals",
            xyDataset, PlotOrientation.VERTICAL, true, true, false);
    ChartPanel cp = new ChartPanel(chart) {

        @Override
        public Dimension getPreferredSize() {
            return new Dimension(320, 240);
        }
    };
    cp.setMouseWheelEnabled(true);
    add(cp);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    pack();
    initComponents();
}