Example usage for org.jfree.chart ChartPanel setPreferredSize

List of usage examples for org.jfree.chart ChartPanel setPreferredSize

Introduction

In this page you can find the example usage for org.jfree.chart ChartPanel setPreferredSize.

Prototype

@BeanProperty(preferred = true, description = "The preferred size of the component.")
public void setPreferredSize(Dimension preferredSize) 

Source Link

Document

Sets the preferred size of this component.

Usage

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

public BarChart3DDemo4(String s) {
    super(s);/*from  ww  w  . j  av  a2 s.c  om*/
    CategoryDataset categorydataset = createDataset();
    JFreeChart jfreechart = createChart(categorydataset);
    ChartPanel chartpanel = new ChartPanel(jfreechart);
    chartpanel.setPreferredSize(new Dimension(500, 270));
    setContentPane(chartpanel);
}

From source file:org.jgrasstools.gears.utils.chart.PlotFrame.java

public void plot() {
    JFreeChart chart = ichart.getChart();
    ChartPanel chartPanel = new ChartPanel(chart, true);
    chartPanel.setPreferredSize(new Dimension(chartWidth, chartHeight));
    setContentPane(chartPanel);/*from w  w  w  .  ja  v a2 s. co m*/

    pack();
    RefineryUtilities.centerFrameOnScreen(this);
    setVisible(true);
}

From source file:Visao.Relatorio.Grafico_QuantidadeReclamacoesSexo.java

private void grafico(JFreeChart chart) {

    ChartPanel panel = new ChartPanel(chart);
    panel.setPreferredSize(new Dimension(600, 600));
    setContentPane(panel);//from w w  w  .jav a 2  s.c o  m
    this.pack();
}

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

/**
 * A demonstration application showing how to create a simple time series chart.
 *
 * @param title  the frame title.// w w w. j  av  a  2  s.  c o  m
 */
public TimeSeriesDemo7(final String title) {

    super(title);

    // create a title...
    final String chartTitle = "Time Series Demo";
    final XYDataset dataset = new TimeSeriesCollection(DemoDatasetFactory.createEURTimeSeries());

    final JFreeChart chart = ChartFactory.createTimeSeriesChart(chartTitle, "Date", "Value", dataset, true,
            true, false);

    final ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
    setContentPane(chartPanel);

}

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

public PeriodAxisDemo2(String s) {
    super(s);//from w  w  w .  ja  v  a  2s . c  o  m
    XYDataset xydataset = createDataset();
    JFreeChart jfreechart = createChart(xydataset);
    ChartPanel chartpanel = new ChartPanel(jfreechart);
    chartpanel.setPreferredSize(new Dimension(500, 270));
    chartpanel.setMouseZoomable(true, false);
    setContentPane(chartpanel);
}

From source file:pertchart.Histogram.java

public void saveChart() {
    JFreeChart chart = createHistorgram(this.data);
    final ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 300));
    setContentPane(chartPanel);/*from w  w  w.  ja v  a 2 s  .  c o m*/
}

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;// ww w .j a v  a2 s. c o m
    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);//from   www.ja  va 2s. 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:org.jfree.chart.demo.LineChart.java

public LineChart(final String title) {

    super(title);

    final XYDataset dataset = createDataset();
    final JFreeChart chart = createChart(dataset);
    final ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
    setContentPane(chartPanel);/*from   w  w  w .  j  a  va  2 s.  c  o  m*/

}

From source file:nodeconfig.FinalFuzzyChart.java

public FinalFuzzyChart(String applicationTitle, String chartTitle) {
    super(applicationTitle);
    JFreeChart barChart = ChartFactory.createBarChart(chartTitle, "Nodes", "Fuzzy", createDataset(),
            PlotOrientation.VERTICAL, true, true, false);

    ChartPanel chartPanel = new ChartPanel(barChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    setContentPane(chartPanel);//from www .ja  va2s . c o  m
}