List of usage examples for org.jfree.chart ChartPanel ChartPanel
public ChartPanel(JFreeChart chart)
From source file:service.chart.FitnessChart.java
public FitnessChart() { dataset = new DefaultCategoryDataset(); JFreeChart chart = createChart(dataset); chartPanel = new ChartPanel(chart); chartPanel.setFillZoomRectangle(true); chartPanel.setMouseWheelEnabled(true); this.add(chartPanel); }
From source file:ui.Graph.java
public Graph(final String title, ArrayList<Setpoint> data, ArrayList<Setpoint> traj, Gains gains) { super(title); this.gains = gains; JFreeChart chart = createChart(data, traj); File imageFile = new File(ConfigFile.getInstance("config.txt").getString("outputPng")); int width = 1280; int height = 960; try {/*from w w w. ja v a 2 s . co m*/ ChartUtilities.saveChartAsPNG(imageFile, chart, width, height); } catch (IOException ex) { System.err.println(ex); } final ChartPanel panel = new ChartPanel(chart); panel.setPreferredSize(new java.awt.Dimension(1500, 800)); this.setContentPane(panel); }
From source file:org.encog.workbench.dialogs.common.ChartField.java
public int createField(JPanel panel, int x, int y, int width) { this.chartHolder = new JPanel(); XYDataset dataset = generator.createDataset(); JFreeChart chart = generator.createChart(dataset); ChartPanel chartPanel = new ChartPanel(chart); chartHolder.setLayout(new BorderLayout()); chartHolder.add(chartPanel, BorderLayout.CENTER); chartHolder.add(this.refreshButton = new JButton("Refresh Chart"), BorderLayout.SOUTH); this.refreshButton.addActionListener(this); this.setField(chartHolder); this.getField().setLocation(5, y); this.getField().setSize(this.getOwner().getWidth() - 5, height); JLabel label = createLabel(); label.setVisible(false);/*from w w w .jav a 2 s . c o m*/ label.setLocation(label.getX(), y); panel.add(label); panel.add(this.getField()); return y + this.getField().getHeight(); }
From source file:ws.moor.bt.gui.charts.TotalBlocksPerPeer.java
public TotalBlocksPerPeer(CounterRepository counterRepository) { super();/*ww w . j a v a2s . c om*/ this.counterRepository = counterRepository; chart = createChart(); setLayout(new BorderLayout()); add(new ChartPanel(chart), BorderLayout.CENTER); }
From source file:Logica.Graficas.java
public JPanel otienePanel() { return new ChartPanel(grafica); }
From source file:UserInterface.PatientRole.VitalSignsChartJPanel.java
/** * Creates new form VitalSignsChartJPanel *///from w ww .j a v a 2 s.c o m public VitalSignsChartJPanel(JPanel userProcessContainer, UserAccount userAccount, PatientOrganization patientOrganization, Enterprise enterprise, EcoSystem ecoSyste) { initComponents(); this.userProcessContainer = userProcessContainer; this.ecoSystem = ecoSystem; this.userAccount = userAccount; this.patientOrganization = (PatientOrganization) patientOrganization; this.enterprise = enterprise; this.patient = userAccount.getPatient(); XYDataset data = createXYDataset(); JFreeChart chart = ChartFactory.createTimeSeriesChart(patient.getPatientName(), "Time", "Data", data); ChartPanel chartPanel = new ChartPanel(chart); this.add(chartPanel, BorderLayout.CENTER); this.validate(); }
From source file:pertchart.Histogram.java
public void saveChart() { JFreeChart chart = createHistorgram(this.data); final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(500, 300)); setContentPane(chartPanel);/* w ww . ja v a2 s .com*/ }
From source file:com.jeco.ui.view.GraficoPeso.java
public void drawGrafico(Ovino ovino) { if (ovino == null) { ovino = new Ovino(); ovino.setCodigo("00"); }/*from w ww . j a v a 2s . co m*/ DefaultCategoryDataset ds = new DefaultCategoryDataset(); for (Pesagem pesagem : ovino.getHistoricoPesos()) { ds.addValue(pesagem.getPeso(), "Peso", pesagem.getData()); } //cria o grafico.. JFreeChart data = ChartFactory.createBarChart("", "Data", "Peso do Ovino " + ovino.getCodigo(), ds, PlotOrientation.VERTICAL, true, true, false); ChartPanel chartPanel = new ChartPanel(data); this.chartPanel = chartPanel; chartPanel.setPreferredSize(new java.awt.Dimension(378, 260)); this.setBackground(new java.awt.Color(255, 255, 255)); this.remove(chartPanel); this.repaint(); this.add(chartPanel); chartPanel.setBackground(new java.awt.Color(255, 255, 255)); this.repaint(); }
From source file:dbseer.gui.frame.DBSeerPredictionFrame.java
private void initializeGUI() throws Exception { this.setLayout(new MigLayout("fill")); this.setPreferredSize(new Dimension(1024, 768)); JFreeChart chart = DBSeerChartFactory.createXYLinePredictionChart(center); JTable errorTable = DBSeerChartFactory.createErrorTable(center); ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new Dimension(1024, 768)); String title = center.getPredictionDescription(); if (center.getTestMode() == DBSeerConstants.TEST_MODE_DATASET) { title += ", Test with Dataset (" + center.getTestDatasetName() + ") "; } else {//from w w w .ja va2 s. c om title += ", Test with Mixture & TPS (" + center.getTestMixture() + ") "; } switch (center.getGroupingType()) { case DBSeerConstants.GROUP_NONE: title += "[Group: None] "; break; case DBSeerConstants.GROUP_REL_DIFF: title += "[Group: Rel. diff (" + center.getAllowedRelativeDiff() + ")] "; break; case DBSeerConstants.GROUP_NUM_CLUSTER: title += "[Group: Clustering (" + center.getNumClusters() + ")] "; break; case DBSeerConstants.GROUP_RANGE: title += "[Group: User-specified range] "; break; default: break; } if (center.getGroupingType() != DBSeerConstants.GROUP_NONE) { switch (center.getGroupingTarget()) { case DBSeerConstants.GROUP_TARGET_INDIVIDUAL_TRANS_COUNT: title += "[Target: Individual transactions]"; break; case DBSeerConstants.GROUP_TARGET_TPS: title += "[Target: TPS]"; break; default: break; } } this.setTitle(title); if (errorTable != null) { this.add(chartPanel, "grow, wrap"); this.add(errorTable, "growx"); } else { this.add(chartPanel, "grow"); } }
From source file:eu.choreos.vv.chart.YIntervalChart.java
public static ChartPanel createChart(String chartTitle, List<PlotData> reports, String xLabel, String yLabel) { YIntervalSeriesCollection dataset = new YIntervalSeriesCollection(); for (PlotData report : reports) { createDataset(dataset, (StatisticalData) report); }//from w w w . ja va2s .c o m JFreeChart chart = createChart(dataset, chartTitle, xLabel, yLabel); ChartPanel panel = new ChartPanel(chart); return panel; }