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:edu.gmu.cs.sim.util.media.chart.BubbleChartGenerator.java

protected void buildChart() {
    DefaultXYZDataset dataset = new DefaultXYZDataset();
    chart = ChartFactory.createBubbleChart("Untitled Chart", "Untitled X Axis", "Untitled Y Axis", dataset,
            PlotOrientation.VERTICAL, false, true, false);
    chart.setAntiAlias(true);//from www . j av a  2 s.  c  o  m
    chartPanel = buildChartPanel(chart);
    setChartPanel(chartPanel);

    // most irritating: you can't change the scale type once you've
    // constructed the renderer.  :-(
    chart.getXYPlot().setRenderer(new XYBubbleRenderer(XYBubbleRenderer.SCALE_ON_DOMAIN_AXIS));

    // this must come last because the chart must exist for us to set its dataset
    setSeriesDataset(dataset);
}

From source file:Charts.BarChart.java

private JFreeChart makeJFreeChart(String title, String x, String y) {
    final JFreeChart barChart = ChartFactory.createBarChart(title, // chart title
            x, // x axis label
            y, // y axis label
            this.createDataset(), // data
            PlotOrientation.VERTICAL, true, // include legend
            true, // tooltips
            false // urls
    );//  www . j av  a2s  .  c om
    return barChart;
}

From source file:kata3.HistogramDisplay.java

private JFreeChart createChart(DefaultCategoryDataset dataset) {
    JFreeChart chart = ChartFactory.createBarChart(null, "Dominios", "N email", dataset,
            PlotOrientation.VERTICAL, false, false, false);

    return chart;
}

From source file:com.oracle.cch.swingtest.ChartJFrame.java

/**
 * Creates new form ChartJFrame/*from   www .  j  a va 2 s . c  o  m*/
 */
public ChartJFrame() {
    initComponents();
    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);
    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);
        }
    };
    FlowLayout fl = new FlowLayout();
    this.setLayout(fl);
    this.add(cp);

    setDefaultCloseOperation(EXIT_ON_CLOSE);
    pack();
}

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

public StackedBarDemo2(String s) {
    super(s);//from www .ja v 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");
    JFreeChart jfreechart = ChartFactory.createStackedBarChart("StackedBarDemo2", "Category", "Value",
            defaultcategorydataset, PlotOrientation.VERTICAL, true, true, false);
    CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot();
    StackedBarRenderer stackedbarrenderer = (StackedBarRenderer) categoryplot.getRenderer();
    stackedbarrenderer.setRenderAsPercentages(true);
    ChartPanel chartpanel = new ChartPanel(jfreechart, false);
    chartpanel.setPreferredSize(new Dimension(500, 270));
    setContentPane(chartpanel);
}

From source file:GUI.PlotHere.java

/**
 * Creates new form PlotHere//from  ww w  . j  a va2 s.com
 */
public PlotHere(String Title) {
    initComponents();
    XYSeries Input00 = new XYSeries("Input 00");
    XYSeries Input01 = new XYSeries("Input 01");
    XYSeries Input02 = new XYSeries("Input 02");
    XYSeriesCollection data = new XYSeriesCollection(Input00);
    data.addSeries(Input01);
    data.addSeries(Input02);
    JFreeChart chart = ChartFactory.createXYLineChart(Title, "Angle", "Voltage", data, PlotOrientation.VERTICAL,
            true, true, false);
    ChartPanel chartpanel = new ChartPanel(chart);
    //chartpanel.setDomainZoomable(true);
    chartpanel.setPreferredSize(new java.awt.Dimension(200, 200));

    //JPanel jPanel4 = new JPanel();

    Component[] a = GraphHerePanel.getComponents();
    if (a.length == 0) {
        GraphHerePanel.setLayout(new BorderLayout());
        GraphHerePanel.add(chartpanel);
    }
    this.revalidate();
    this.repaint();

}

From source file:kata.pkg3.HistogramaDisplay.java

private JFreeChart createChart(DefaultCategoryDataset dataset) {
    JFreeChart chart = ChartFactory.createBarChart("Histograma de dominios", "DOMINIOS", "N Email", dataset,
            PlotOrientation.VERTICAL, true, true, false);
    return chart;
}

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

private static JFreeChart createChart(CategoryDataset categorydataset) {
    JFreeChart jfreechart = ChartFactory.createBarChart3D("Cylinder Chart Demo 1", "Category", "Value",
            categorydataset, PlotOrientation.VERTICAL, false, true, false);
    CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot();
    Paint apaint[] = createPaint();
    CustomCylinderRenderer customcylinderrenderer = new CustomCylinderRenderer(apaint);
    customcylinderrenderer.setGradientPaintTransformer(
            new StandardGradientPaintTransformer(GradientPaintTransformType.CENTER_HORIZONTAL));
    customcylinderrenderer.setBaseOutlinePaint(Color.gray);
    customcylinderrenderer.setBaseOutlineStroke(new BasicStroke(0.3F));
    customcylinderrenderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
    categoryplot.setRenderer(customcylinderrenderer);
    return jfreechart;
}

From source file:SyntheticData.XYLineChart.java

public XYLineChart(String applicationTitle, String chartTitle, String xaxislabel, String yaxislabel,
        XYSeriesCollection dataset) throws IOException {

    super(applicationTitle);
    JFreeChart xylinechart = ChartFactory.createXYLineChart(chartTitle, xaxislabel, yaxislabel, dataset,
            PlotOrientation.VERTICAL, true, true, false);

    ChartPanel cpanel = new ChartPanel(xylinechart);
    cpanel.setPreferredSize(new java.awt.Dimension(500, 500));
    final XYPlot xyplot = xylinechart.getXYPlot();
    XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
    renderer.setSeriesPaint(0, Color.blue);
    renderer.setSeriesStroke(0, new BasicStroke(2.0f));
    xyplot.setRenderer(renderer);/*from www .  ja  v a2  s .c om*/
    setContentPane(cpanel);
    File saveImageFile = new File("" + applicationTitle + ".jpg");
    ChartUtilities.saveChartAsJPEG(saveImageFile, xylinechart, 1920, 1080);
}

From source file:estimatePressure.CreateGraph.java

public CreateGraph(String applicationTitle, String chartTitle, Matrix errData, int sensorNum) {
    super(applicationTitle);
    this.errorData = errData;
    this.sensorNumber = sensorNum;
    JFreeChart lineChart = ChartFactory.createLineChart(chartTitle, "Time", "Error", createDataset(),
            PlotOrientation.VERTICAL, true, true, false);
    //lineChart.setBackgroundPaint(Color.red);
    ChartPanel chartPanel = new ChartPanel(lineChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(1200, 500));
    setContentPane(chartPanel);//from   ww  w  .j av a 2s  .  c  om

    File fileLineChart = new File("Error values" + this.sensorNumber + ".jpeg");
    try {
        ChartUtilities.saveChartAsJPEG(fileLineChart, lineChart, 1200, 500);
    } catch (IOException e) {
        e.printStackTrace();
    }

}