Example usage for org.jfree.chart ChartFrame add

List of usage examples for org.jfree.chart ChartFrame add

Introduction

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

Prototype

public Component add(Component comp) 

Source Link

Document

Appends the specified component to the end of this container.

Usage

From source file:vinci.project2.pkg1.View.java

/**
 * Initializes the chart/* w  w w.  j  a v a2  s  .  c  o m*/
 */
private void setChart() {
    final JFreeChart chart = createChart(gd.createDataset(xySeries1, xySeries2, xySeries3));
    ChartPanel chartPanel = new ChartPanel(chart);

    chartPanel.setSize(400, 300);

    ChartFrame chartFrame = new ChartFrame("Taxes", chart);
    chartFrame.setSize(400, 300);

    chartFrame.add(chartPanel);
    chartFrame.pack();
    chartFrame.setVisible(false);

    chartFrame1.add(chartPanel);

    chartFrame1.setSize(400, 300);
    chartFrame1.repaint();
    chartFrame1.revalidate();
}