예제 #1
0
  protected void jComboBoxItemStateChanged() {

    try {

      XYDataset dataset;
      String yTitle;

      if (comboBox.getItemCount() != 0) {

        dataset = createDataset(comboBox.getSelectedItem().toString());
        yTitle = comboBox.getSelectedItem().toString();
      } else {
        dataset = null;
        yTitle = new String();
      }

      createChart(dataset, chartTitle, xTitle, yTitle);

      chartPanel.removeAll();

      chartPanel.setChart(chart);

      chartPanel.repaint();

    } catch (Exception e) {
    }
  }
예제 #2
0
 @Override
 public void queryPerformed(SampleEvent e) {
   JFreeChart chart = e.getHistogram().getChart(e.getTitle());
   if (chartPanel != null) {
     chartPanel.setChart(chart);
   } else {
     chartPanel = new ChartPanel(chart);
     chartPanel.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
     add(chartPanel, BorderLayout.CENTER);
   }
   validate();
 }
예제 #3
0
파일: View.java 프로젝트: JohnCIT/saving
 public void setChart(JFreeChart chart) {
   chartPanel.setChart(chart);
 }
예제 #4
0
  /** converts data into a candlestick chart */
  public void convert() {

    chart.setAntiAlias(false);
    chartPanel.setChart(chart);
  }
예제 #5
0
 private void updateChart() {
   // First Panel
   CategoryDataset dataset = createPositionDataset();
   JFreeChart chart = createChart(dataset);
   chartPanel.setChart(chart);
 }
예제 #6
0
  /**
   * Creates the JFreeChart data from the Gantt data
   *
   * @param gantt the input data
   */
  public void plot(Gantt gantt, ChartPanel chartPanel) {

    JFreeChart chart = createChart(gantt, createDataset(gantt));

    chartPanel.setChart(chart);
  }