List of usage examples for org.jfree.chart.plot PlotOrientation VERTICAL
PlotOrientation VERTICAL
To view the source code for org.jfree.chart.plot PlotOrientation VERTICAL.
Click Source Link
From source file:edu.pdi2.visual.ViewSignature.java
public ViewSignature(String name, byte[] sign) { super();/*from w ww .jav a2s.c o m*/ XYSeries signature = new XYSeries("Signature"); for (int i = 0; i < sign.length; i++) { signature.add(i, sign[i]); } JFrame frame = new JFrame(); XYSeriesCollection dataset = new XYSeriesCollection(); dataset.addSeries(signature); JFreeChart signatureG = ChartFactory.createXYLineChart("Signature " + name, "Valorx", "Valory", dataset, PlotOrientation.VERTICAL, true, true, false); ChartPanel chartpanel = new ChartPanel(signatureG); chartpanel.setPreferredSize(new Dimension(390, 290)); frame.setContentPane(chartpanel); frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); frame.pack(); frame.setSize(400, 300); frame.setVisible(true); if (name == " RED") frame.setLocation(0, 300); else frame.setLocation(400, 300); }
From source file:de.fub.maps.project.plugins.tasks.eval.heading.HeadingHistogramm.java
/** * Creates new form HeadingHistogramm/*from www .j a v a2 s.c o m*/ */ public HeadingHistogramm() { initComponents(); barChart = ChartFactory.createXYBarChart(null, "Degree", false, null, dataset, PlotOrientation.VERTICAL, true, true, true); barChart.setBackgroundPaint(Color.WHITE); barChart.getPlot().setBackgroundPaint(Color.WHITE); XYBarRenderer barRenderer = new XYBarRenderer(.05); barRenderer.setShadowVisible(false); barRenderer.setBarPainter(new StandardXYBarPainter()); barRenderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); barChart.getXYPlot().setRenderer(barRenderer); chartpanel = new ChartPanel(barChart, false); add(chartpanel, BorderLayout.CENTER); }
From source file:max.hubbard.Factoring.Graphing.java
private static JFreeChart createChart(final XYDataset dataset, String equation) { // create the chart... final JFreeChart chart = ChartFactory.createXYLineChart(equation, // chart title "X", // x axis label "Y", // y axis label dataset, // data PlotOrientation.VERTICAL, true, // include legend true, // tooltips false // urls );//from w w w.j a v a 2s. c o m // NOW DO SOME OPTIONAL CUSTOMISATION OF THE CHART... chart.setBackgroundPaint(Color.white); // final StandardLegend legend = (StandardLegend) chart.getLegend(); // legend.setDisplaySeriesShapes(true); // get a reference to the plot for further customisation... final XYPlot plot = chart.getXYPlot(); plot.setBackgroundPaint(Color.lightGray); // plot.setAxisOffset(new Spacer(Spacer.ABSOLUTE, 5.0, 5.0, 5.0, 5.0)); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(); renderer.setSeriesLinesVisible(0, true); renderer.setSeriesShapesVisible(0, true); plot.setRenderer(renderer); // change the auto tick unit selection to integer units only... final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setRange(new Range(-50, 50)); // OPTIONAL CUSTOMISATION COMPLETED. return chart; }
From source file:views.analysis.LinearRegressionDisplay.java
@Override public void initialize() { JFreeChart lineChart = ChartFactory.createLineChart(this.getTitle(), "Temps", "Valeurs", createDataset(), PlotOrientation.VERTICAL, true, true, false); ChartPanel chartPanel = new ChartPanel(lineChart); chartPanel.setPreferredSize(new java.awt.Dimension(560, 367)); setContentPane(chartPanel);// w ww. j ava 2 s . c o m }
From source file:com.raghav.plot.XYSeriesDemo.java
/** * A demonstration application showing an XY series containing a null value. * * @param title the frame title.//from w w w.ja v a 2s.c o m */ public XYSeriesDemo(final String title) { super(title); final XYSeries series = new XYSeries("Random Data"); // float x=1; // float y=(float)((Math.sqrt(2))*x); // for (int i = 1; i < 200000; i++) { double x = (((double) (i)) / 1000); System.out.print("x = " + x); double xdb = 10 * (Math.log10(x)); System.out.print("\t 10logx=" + xdb); double y = Erf.erfc(Math.sqrt(x)); System.out.print("\t y=" + y); System.out.println("----------------------"); series.add(xdb, y); } final XYSeriesCollection data = new XYSeriesCollection(series); final JFreeChart chart = ChartFactory.createXYLineChart("XY Series Demo", "X", "Y", data, PlotOrientation.VERTICAL, true, true, false); final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(500, 270)); setContentPane(chartPanel); }
From source file:cgpanalyser.gui.chart.ChartCreator.java
private JFreeChart createChart(XYDataset dataset) { JFreeChart chart = ChartFactory.createXYLineChart(null, "Generation", "Fitness", dataset, PlotOrientation.VERTICAL, false, true, false); if (dataset != null) { XYPlot plot = (XYPlot) chart.getPlot(); setCrosshairProperties(plot, true); setCrosshairDefaultValue(plot, dataset); setBothAxisProperties(plot, dataset); setShapes(plot);// w ww. j av a 2 s .c o m //setRenderer(plot, dataset); } return chart; }
From source file:Charts.LineChart.java
private JFreeChart makeJFreeChart(String title, String x, String y) { final JFreeChart lineChart = ChartFactory.createXYLineChart(title, // chart title x, // x axis label y, // y axis label this.createDataset(), // data PlotOrientation.VERTICAL, true, // include legend true, // tooltips false // urls );/*from w w w.j a va 2 s. c om*/ return lineChart; }
From source file:grafica.Lineal.java
private static JFreeChart crearGrafico(XYSeriesCollection cjto_datos) { JFreeChart grafico = ChartFactory.createXYLineChart("Fitness vs. Generacin", // Ttulo "Generaciones", // Ttulo eje x "Fitness", // Ttulo eje y cjto_datos, // Datos PlotOrientation.VERTICAL, // Orientacin true, // Incluir leyenda true, // Incluir tooltips false // Incluir URLs );/*from w ww . j a va 2 s .c om*/ return grafico; }
From source file:include.picture.MyBarChart.java
/** *? *//*from w w w .j a v a2 s .c o m*/ public void paint() { try { check(); CategoryDataset dataset = getDataSet(series, category, data); JFreeChart chart = ChartFactory.createBarChart3D(title, axisXLabel, axisYLabel, dataset, PlotOrientation.VERTICAL, true, false, false); chart.setBackgroundPaint(Color.WHITE); BarRenderer3D renderer = new BarRenderer3D(); CategoryPlot plot = chart.getCategoryPlot(); renderer.setMaxBarWidth(0.01); renderer.setBaseOutlinePaint(Color.BLACK); renderer.setItemLabelGenerator(new StandardCategoryItemLabelGenerator()); renderer.setItemLabelFont(new Font("", Font.PLAIN, 15)); renderer.setItemLabelsVisible(true); renderer.setItemMargin(0.1); plot.setRenderer(renderer); FileOutputStream fos_jpg = null; try { fos_jpg = new FileOutputStream(fileName); ChartUtilities.writeChartAsJPEG(fos_jpg, 1000, chart, width, height, null); } finally { try { fos_jpg.close(); } catch (Exception e) { } } } catch (Exception e) { e.printStackTrace(); } // end of try-catch }
From source file:com.bdb.weather.display.summary.RainHourChart.java
public RainHourChart() { for (int i = 0; i < 24; i++) hourRainDataset.addValue(0.0, CATEGORY_NAME, Integer.toString(i)); JFreeChart rainChart = ChartFactory.createBarChart(null, "Hour", "", hourRainDataset, PlotOrientation.VERTICAL, false, true, false); ChartViewer rainChartViewer = new ChartViewer(rainChart); rainChartViewer.setMaxHeight(10000); rainChartViewer.setMaxWidth(10000);/*w w w. j a va 2 s . c o m*/ rainChartViewer.setPrefSize(800, 200); plot = (CategoryPlot) rainChart.getPlot(); plot.setRangeAxis(RainRangeAxis.create()); this.getChildren().add(rainChartViewer); }