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:nodeconfig.BarChart_fuzzy.java

public BarChart_fuzzy(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);/*  w  w w.  j  ava  2  s .c om*/
}

From source file:nodeconfig.BarChart_parameters.java

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

    ChartPanel chartPanel = new ChartPanel(barChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    setContentPane(chartPanel);//from w w  w .j a va  2 s. co m
}

From source file:brightwell.gui.drawingplane.Chart3D.java

public void doneValues() {
    CategoryDataset categorydataset = createDataset();
    JFreeChart jfreechart = createChart(categorydataset);
    ChartPanel chartpanel = new ChartPanel(jfreechart);
    chartpanel.setPreferredSize(new Dimension(500, 270));
    setContentPane(chartpanel);//from  w  w w.  j a v  a 2s .  co m
}

From source file:views.analysis.ResidualPlotDisplay.java

@Override
public void initialize() {
    JFreeChart lineChart = ChartFactory.createScatterPlot(this.getTitle(), "Temps", "Rsidus",
            createDataset());/*from   w  w w.j a v a  2 s. com*/

    ChartPanel chartPanel = new ChartPanel(lineChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    setContentPane(chartPanel);
}

From source file:com.insa.tp3g1.esbsimulator.view.PieChart.java

public PieChart(String chartTitle, int lost) {
    //  super(applicationTitle);
    // This will create the dataset 
    PieDataset dataset = createDataset(lost);
    // based on the dataset we create the chart
    JFreeChart chart = createChart(dataset, chartTitle);
    // we put the chart into a panel
    ChartPanel chartPanel = new ChartPanel(chart);
    // default size
    chartPanel.setPreferredSize(new java.awt.Dimension(500, 270));
    // add it to our application
    setContentPane(chartPanel);//from  w  w w .  j  a  v a2  s  . c  o m

}

From source file:my.demo.BarChart.java

public BarChart(String applicationTitle, String chartTitle, CategoryDataset dataset, JPanel jp) {
    super(applicationTitle);
    JFreeChart barChart = ChartFactory.createBarChart(chartTitle, "Type", "FScore", dataset,
            PlotOrientation.VERTICAL, true, true, false);

    ChartPanel chartPanel = new ChartPanel(barChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(650, 350));

    setContentPane(chartPanel);// ww w.  j a  v a2s .  c  om
    jp.add(chartPanel);

}

From source file:charts.ErroresPorMilChart.java

public ChartPanel getChartPanel(String chartTitle, JTable table) {

    DefaultCategoryDataset dataset = createDataset(table);
    JFreeChart chart = createChart(dataset, chartTitle);
    ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new Dimension(450, 440));
    chartPanel.setMouseWheelEnabled(true);
    return chartPanel;

}

From source file:charts.ErrorPorcentajePie.java

public ChartPanel getChartPanel(String chartTitle, JTable table, int total) {

    PieDataset dataset = creaDataset(table, total);
    JFreeChart chart = createChart(dataset, chartTitle);
    ChartPanel chartPanel = new ChartPanel(chart);
    chartPanel.setPreferredSize(new Dimension(450, 440));
    chartPanel.setMouseWheelEnabled(true);
    return chartPanel;

}

From source file:com.raghav.plot.XYSeriesDemo.java

/**
 * A demonstration application showing an XY series containing a null value.
 *
 * @param title  the frame title.//  w  ww.j a  v  a 2  s.  co  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:metodosnumericos.Graficador.java

public ChartPanel series(String f, double xi, double xs) {

    Evaluador func = new Evaluador();
    XYSeries series = new XYSeries("Funcion");

    double iter = xi;
    while (iter < xs) {
        double y = func.Evaluador2(f, iter);
        series.add(iter, y);/*from   www . jav a2s. c o  m*/
        System.out.println(iter + " " + y);
        iter = iter + 0.2;
    }
    XYSeriesCollection collection = new XYSeriesCollection(series);

    JFreeChart chart = ChartFactory.createXYLineChart("Grafica", "X", "Y", collection);

    ChartPanel panel = new ChartPanel(chart);
    panel.setPreferredSize(new java.awt.Dimension(400, 300));
    return panel;
}