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) { } }
@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(); }
public void setChart(JFreeChart chart) { chartPanel.setChart(chart); }
/** converts data into a candlestick chart */ public void convert() { chart.setAntiAlias(false); chartPanel.setChart(chart); }
private void updateChart() { // First Panel CategoryDataset dataset = createPositionDataset(); JFreeChart chart = createChart(dataset); chartPanel.setChart(chart); }
/** * 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); }