List of usage examples for org.jfree.chart ChartPanel setPreferredSize
@BeanProperty(preferred = true, description = "The preferred size of the component.") public void setPreferredSize(Dimension preferredSize)
From source file:business.management.system.TeamStatistics.java
/** * Creates new form TeamStatistics//w w w . j a v a 2 s. com */ public TeamStatistics() throws SQLException { initComponents(); JFreeChart pieChart = ChartFactory.createPieChart("Completed projects", createPieDataset()); ChartPanel chartPanel1 = new ChartPanel(pieChart); chartPanel1.setPreferredSize(new java.awt.Dimension(560, 367)); add(chartPanel1); JPanel panel = new JPanel(); panel.add(chartPanel1); setContentPane(panel); }
From source file:exemploJFreeChart.TelaGrafico.java
public TelaGrafico() { janela = new ApplicationFrame("Exemplo JFreeChart"); janela.setDefaultCloseOperation(ApplicationFrame.EXIT_ON_CLOSE); JFreeChart graficoLinha = ChartFactory.createLineChart("Titulo do Grafico", "Nome do eixo X", "Nome do eixo Y", criarDataset(), // mtodo que cria os dados do grfico PlotOrientation.VERTICAL, true, true, false); // legenda, tooltips, urls ChartPanel painelGrafico = new ChartPanel(graficoLinha); painelGrafico.setPreferredSize(new Dimension(600, 400)); janela.setContentPane(painelGrafico); janela.pack();//from www. j a v a 2 s. c om RefineryUtilities.centerFrameOnScreen(janela); }
From source file:ssq.stock.gui.CandlestickDemo.java
/** * A demonstration application showing a candlestick chart. * * @param title/*www . ja va 2s . com*/ * the frame title. */ public CandlestickDemo(final String title) { super(title); final DefaultHighLowDataset dataset = DemoDatasetFactory.createHighLowDataset(); final JFreeChart chart = createChart(dataset); chart.getXYPlot().setOrientation(PlotOrientation.VERTICAL); final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(500, 270)); setContentPane(chartPanel); }
From source file:org.jfree.chart.demo.CandlestickDemo.java
/** * A demonstration application showing a candlestick chart. * * @param title the frame title.//from www . jav a2 s . c om */ public CandlestickDemo(final String title) { super(title); final DefaultHighLowDataset dataset = DemoDatasetFactory.createHighLowDataset(); final JFreeChart chart = createChart(dataset); chart.getXYPlot().setOrientation(PlotOrientation.VERTICAL); final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(500, 270)); setContentPane(chartPanel); }
From source file:kata.pkg3.HistogramaDisplay.java
private ChartPanel createPanel() { ChartPanel chartPanel = new ChartPanel(createChart(createDataset())); chartPanel.setPreferredSize(new Dimension(500, 450)); return chartPanel; }
From source file:kata5v2.HistogramDisplay.java
private ChartPanel createPanel() { ChartPanel chartPanel = new ChartPanel(createChart(createDataset())); chartPanel.setPreferredSize(new Dimension(500, 450)); return chartPanel; }
From source file:org.jfree.chart.demo.MouseListenerDemo3.java
public MouseListenerDemo3(String s) { super(s);/*from w w w .j av a2s . co m*/ String s1 = "Legal & General Unit Trust Prices"; XYDataset xydataset = createDataset(); chart = ChartFactory.createTimeSeriesChart(s1, "Date", "Price Per Unit", xydataset, true, true, false); chart.addSubtitle(new TextTitle("Click on the legend to see series highlighted...")); XYPlot xyplot = (XYPlot) chart.getPlot(); DateAxis dateaxis = (DateAxis) xyplot.getDomainAxis(); dateaxis.setDateFormatOverride(new SimpleDateFormat("MMM-yyyy")); ChartPanel chartpanel = new ChartPanel(chart); chartpanel.setPreferredSize(new Dimension(500, 270)); chartpanel.setMouseZoomable(true, false); chartpanel.addChartMouseListener(this); setContentPane(chartpanel); }
From source file:org.jfree.chart.demo.ScatterPlotDemo4.java
/** * A demonstration application showing a scatter plot. * * @param title the frame title.// w w w . jav a2 s . com */ public ScatterPlotDemo4(final String title) { super(title); final XYDataset data = new SampleXYDataset2(); final JFreeChart chart = ChartFactory.createScatterPlot("Scatter Plot Demo", "X", "Y", data, PlotOrientation.VERTICAL, true, true, false); final XYPlot plot = chart.getXYPlot(); plot.setRenderer(new XYDotRenderer()); plot.setDomainCrosshairVisible(true); plot.setRangeCrosshairVisible(true); final NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis(); domainAxis.setAutoRangeIncludesZero(false); final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(500, 270)); setContentPane(chartPanel); }
From source file:presentationLayer.PredictionGraph.java
public PredictionGraph(String applicationTitle, String chartTitle, double y, int i) { super(applicationTitle); y1 = y;//from w w w . j av a 2 s. co m id = i; JFreeChart lineChart = ChartFactory.createLineChart(chartTitle, "Order", "Rs.", createDataset(), PlotOrientation.VERTICAL, true, true, false); ChartPanel chartPanel = new ChartPanel(lineChart); chartPanel.setPreferredSize(new java.awt.Dimension(560, 367)); setContentPane(chartPanel); }
From source file:org.jfree.chart.demo.WaferMapChartDemo.java
/** * Creates a new demo.//w ww . ja v a 2 s .c o m * * @param title the frame title. */ public WaferMapChartDemo(final String title) { super(title); final WaferMapDataset dataset = DemoDatasetFactory.createRandomWaferMapDataset(5); final JFreeChart chart = ChartFactory.createWaferMapChart("Wafer Map Demo", // title dataset, // wafermapdataset PlotOrientation.VERTICAL, // vertical = notchdown true, // legend false, // tooltips false); // final Legend legend = chart.getLegend(); // legend.setAnchor(Legend.EAST); chart.setBackgroundPaint(new GradientPaint(0, 0, Color.white, 0, 1000, Color.blue)); final TextTitle copyright = new TextTitle("JFreeChart WaferMapPlot", new Font("SansSerif", Font.PLAIN, 9)); copyright.setPosition(RectangleEdge.BOTTOM); copyright.setHorizontalAlignment(HorizontalAlignment.RIGHT); chart.addSubtitle(copyright); final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(500, 400)); setContentPane(chartPanel); }