Example usage for org.jfree.chart ChartPanel ChartPanel

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

Introduction

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

Prototype

public ChartPanel(JFreeChart chart) 

Source Link

Document

Constructs a panel that displays the specified chart.

Usage

From source file:Graphic.camembert.java

public camembert(List<Float> valeurs) {
    DefaultPieDataset pieDataset = new DefaultPieDataset();
    for (int i = 0; i < valeurs.size(); i++) {
        pieDataset.setValue("" + (i + 1), valeurs.get(i));
    }// w  w  w .j  av  a  2s.c om

    final JFreeChart pieChart = ChartFactory.createPieChart("Repartition des camions", pieDataset, true, false,
            false);
    final ChartPanel cPanel = new ChartPanel(pieChart);
    add(cPanel);

}

From source file:jfree.GraficoDeBarras.java

public GraficoDeBarras(String tituloGrafico, String label, float[][] valores) {
    super(tituloGrafico);
    convertirValoresADouble(valores);//from   w w w. j  a v  a 2s  . c om
    this.label = label;
    JFreeChart barChart = ChartFactory.createBarChart(tituloGrafico, "Intervalo", "Frecuencia", createDataset(),
            PlotOrientation.VERTICAL, true, true, false);

    ChartPanel chartPanel = new ChartPanel(barChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    setContentPane(chartPanel);
    pack();
    RefineryUtilities.centerFrameOnScreen(this);
    setVisible(true);
}

From source file:graficos.GraficoTeste.java

public JPanel getPanel() {
    return new ChartPanel(grafico);
}

From source file:TemHm.LineChart_AWT.java

public LineChart_AWT(String applicationTitle, String chartTitle) {
    super(applicationTitle);
    JFreeChart lineChart = ChartFactory.createLineChart(chartTitle, "Registo", "temperatura", createDataset(),
            PlotOrientation.VERTICAL, true, true, false);

    ChartPanel chartPanel = new ChartPanel(lineChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    setContentPane(chartPanel);//www.  j  a va2s.  c o m
}

From source file:nodeconfig.SuspectLine.java

public SuspectLine(String applicationTitle, String chartTitle) {
    super(applicationTitle);
    JFreeChart lineChart = ChartFactory.createLineChart(chartTitle, "Nodes", "Degree Of Suspect",
            createDataset(), PlotOrientation.VERTICAL, true, true, false);

    ChartPanel chartPanel = new ChartPanel(lineChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    setContentPane(chartPanel);/*  w w w. j av  a  2  s  .  c  o  m*/
}

From source file:kata.pkg3.HistogramDisplay.java

private ChartPanel createpanel() {
    ChartPanel chartPanel = new ChartPanel(createChart(createDataset()));
    //Dimensionamos la ventana que vamos a crear
    chartPanel.setPreferredSize(new Dimension(500, 400));
    return chartPanel;
}

From source file:chart.BarChart_AWT.java

public BarChart_AWT(String applicationTitle, String chartTitle) {
    super(applicationTitle);
    JFreeChart barChart = ChartFactory.createBarChart(chartTitle, "Category", "Score", createDataset(),
            PlotOrientation.VERTICAL, true, true, false);

    ChartPanel chartPanel = new ChartPanel(barChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(560, 367));
    setContentPane(chartPanel);/*  www.jav a  2s. com*/
}

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

public XYLineAndShapeRendererDemo1(String s) {
    super(s);/*  w w  w  .  j a v a2 s . c  o  m*/
    XYDataset xydataset = createDataset();
    JFreeChart jfreechart = createChart(xydataset);
    ChartPanel chartpanel = new ChartPanel(jfreechart);
    chartpanel.setPreferredSize(new Dimension(500, 300));
    setContentPane(chartpanel);
}

From source file:FECTester.Chart.java

public Chart(String name, String xLabel, String yLabel) {
    super(name);/*from   w w w  . j a v  a2  s  .c o  m*/
    JFreeChart lineChart = ChartFactory.createXYLineChart(name, xLabel, yLabel, dataset,
            PlotOrientation.VERTICAL, true, true, false);
    ChartPanel chartPanel = new ChartPanel(lineChart);
    chartPanel.setPreferredSize(new java.awt.Dimension(600, 450));
    setContentPane(chartPanel);
    this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    this.setSize(600, 450);
    this.setResizable(false);
    this.setVisible(false);
}

From source file:jprobix.ui.SPlotFinal.java

public static JPanel creteDemoPanel() {
    JFreeChart jfreechart = ChartFactory.createScatterPlot("Scatter plot demo", "X", "Y", samplexydataset2(),
            PlotOrientation.VERTICAL, true, true, false);

    Shape cross = ShapeUtilities.createDiagonalCross(3, 2);
    XYPlot xyPlot = (XYPlot) jfreechart.getPlot();
    xyPlot.setDomainCrosshairVisible(true);
    xyPlot.setRangeCrosshairVisible(true);
    XYItemRenderer renderer = xyPlot.getRenderer();
    renderer.setSeriesShape(5, cross);//www. j a  v  a2 s.c  o  m
    renderer.setSeriesPaint(0, Color.YELLOW);

    XYDotRenderer xydotrenderer = new XYDotRenderer();
    xyPlot.setRenderer(xydotrenderer);
    xydotrenderer.setSeriesShape(0, cross);

    xyPlot.setDomainCrosshairVisible(true);
    xyPlot.setRangeCrosshairVisible(true);

    return new ChartPanel(jfreechart);
}