title: How do I change a JFreeChart's size
body: <p>I've added a <code>JFreeChart</code> to a <code>JPanel</code> (using a <code>BorderLayout</code>), and it's <em>huge</em>. Is there something I can do to make it smaller?</p>
  
  <pre><code>public void generateChart()
  {
      DefaultCategoryDataset dataset = new DefaultCategoryDataset();
  
      //set the values of the chart
      for(int i=0; i&lt;8; i++)
      {
          dataset.setValue(income_array[i], "Income",
              Double.toString(percent_array[i]));
      }
  
      JFreeChart chart = ChartFactory.createBarChart(
          "Required Annual Income for a Variety of Interest Rates",
          "Percent", "Income", dataset, PlotOrientation.VERTICAL,
          false,true, false);
      ChartPanel cp = new ChartPanel(chart);
  
      chart.setBackgroundPaint(Color.white);
      chart.getTitle().setPaint(Color.black); 
      CategoryPlot p = chart.getCategoryPlot(); 
      p.setRangeGridlinePaint(Color.blue); 
  
      //cp.setMaximumDrawHeight(5);
      //cp.setMaximumDrawWidth(5);
      //cp.setZoomOutFactor(.1);
      JPanel graph = new JPanel();
      graph.add(cp);
      middle.add(graph, BorderLayout.CENTER);
  }   
  </code></pre>