List of usage examples for org.jfree.chart ChartFrame setSize
public void setSize(int width, int height)
The width and height values are automatically enlarged if either is less than the minimum size as specified by previous call to setMinimumSize .
From source file:dumbara.view.Chart1.java
public static void paymentHistory() { DefaultCategoryDataset objDataset = new DefaultCategoryDataset(); try {//from w w w . ja va 2s . co m LoanSettle[] loanSettles = LoanSettleController.viewLoanSettle(); for (LoanSettle loanSettle : loanSettles) { objDataset.setValue(Double.parseDouble(loanSettle.getPayment()), "Loan Payments", loanSettle.getLoanSettleID()); } } catch (ClassNotFoundException | SQLException ex) { Logger.getLogger(Chart1.class.getName()).log(Level.SEVERE, null, ex); } // JFreeChart objChart = ChartFactory.createBarChart("Sales Comparisson", "Sales ID", "Sales Income", objDataset, PlotOrientation.VERTICAL, true, true, false); ChartFrame frame = new ChartFrame("Data Analysis Wizard - v2.1.4", objChart); frame.pack(); frame.setSize(1000, 600); frame.setVisible(true); frame.setLocationRelativeTo(null); }
From source file:dumbara.view.Chart1.java
public static void paymentHistorybyEmp(String empID) { DefaultCategoryDataset objDataset = new DefaultCategoryDataset(); try {/*from w w w . j ava2s .c o m*/ LoanSettle[] loanSettles = LoanSettleController.viewLoanSettlebyEmp(empID); for (LoanSettle loanSettle : loanSettles) { objDataset.setValue(Double.parseDouble(loanSettle.getPayment()), "Loan Payments", loanSettle.getLoanSettleID()); } } catch (ClassNotFoundException | SQLException ex) { Logger.getLogger(Chart1.class.getName()).log(Level.SEVERE, null, ex); } // JFreeChart objChart = ChartFactory.createBarChart("Loan Settlements of Employee No " + empID, "Loan Settle ID", "Amount (Rs.)", objDataset, PlotOrientation.VERTICAL, true, true, false); ChartFrame frame = new ChartFrame("Data Analysis Wizard - v2.1.4", objChart); frame.pack(); frame.setSize(1000, 600); frame.setVisible(true); frame.setLocationRelativeTo(null); }
From source file:dumbara.view.Chart1.java
public static void getBottleIncome() { DefaultCategoryDataset objDataset = new DefaultCategoryDataset(); try {//www .j a v a2 s . com Chart3[] chart3s = SalesController.getBottleIncome(); for (Chart3 chart3 : chart3s) { objDataset.setValue(chart3.getIncome(), "Bottle Income", chart3.getBottleID()); } } catch (ClassNotFoundException | SQLException ex) { Logger.getLogger(Chart1.class.getName()).log(Level.SEVERE, null, ex); } // Calendar cal = Calendar.getInstance(); cal.add(Calendar.MONTH, -1); Date result = cal.getTime(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("E yyyy.MM.dd"); String format = simpleDateFormat.format(result); Date date = new Date(); String format1 = simpleDateFormat.format(date); JFreeChart objChart = ChartFactory.createBarChart( "Sales Comparisson by Bottle ID from " + format + " to " + format1, "Bottle ID", "Sales Income", objDataset, PlotOrientation.VERTICAL, true, true, false); ChartFrame frame = new ChartFrame("Data Analysis Wizard - v2.1.4", objChart); frame.pack(); frame.setSize(1000, 600); frame.setVisible(true); frame.setLocationRelativeTo(null); }
From source file:dumbara.view.Chart1.java
public static void byIncome() { DefaultCategoryDataset objDataset = new DefaultCategoryDataset(); try {/* w w w . j ava 2s . co m*/ Sale[] sale = SalesController.viewAllSales(); for (Sale sale1 : sale) { objDataset.setValue(sale1.getIncome(), "Sales Progress", sale1.getSalesID()); } } catch (ClassNotFoundException | SQLException ex) { Logger.getLogger(Chart1.class.getName()).log(Level.SEVERE, null, ex); } Calendar cal = Calendar.getInstance(); cal.add(Calendar.MONTH, -1); Date result = cal.getTime(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("E yyyy.MM.dd"); String format = simpleDateFormat.format(result); Date date = new Date(); String format1 = simpleDateFormat.format(date); JFreeChart objChart = ChartFactory.createBarChart( "Sales Comparisson by Sales ID from " + format + " to " + format1, "Sales ID", "Sales Income", objDataset, PlotOrientation.VERTICAL, true, true, false ); ChartFrame frame = new ChartFrame("Data Analysis Wizard - v2.1.4", objChart); frame.pack(); frame.setSize(1300, 600); frame.setVisible(true); frame.setLocationRelativeTo(null); }
From source file:framepackage.MyPieChart.java
public MyPieChart() { DefaultPieDataset pieDataset = new DefaultPieDataset(); pieDataset.setValue("Online", new Integer(10)); pieDataset.setValue("Offline", new Integer(20)); pieDataset.setValue("Busy", new Integer(30)); pieDataset.setValue("Away", new Integer(40)); JFreeChart chart = ChartFactory.createPieChart("my pie", pieDataset, true, true, true); PiePlot P = (PiePlot) chart.getPlot(); //P.setForegroundAlpha(TOP_ALIGNMENT); ChartFrame f = new ChartFrame("chart", chart); f.setVisible(true);/*from w w w .j av a 2 s . com*/ f.setSize(500, 700); }
From source file:metier.Freechart.java
public void stats() { List<Produit> produits = ProduitDAO.getInstance().readAll(); DefaultPieDataset pieDataset = new DefaultPieDataset(); for (Produit pr : produits) { pieDataset.setValue(pr.getNom(), new Integer(pr.getQuantiteInitial() - pr.getQuantiteDisponible())); }/*from w w w .ja va2s . com*/ JFreeChart chart = ChartFactory.createPieChart("Pie Chart", pieDataset, true, true, true); //.createPieChart(PieChart, pieDataset, true, true, true); PiePlot P = (PiePlot) chart.getPlot(); P.setForegroundAlpha(TOP_ALIGNMENT); ChartFrame frame = new ChartFrame("Pie Chart", chart); frame.setVisible(true); frame.setSize(450, 500); }
From source file:com.hello2morrow.sonargraph.jenkinsplugin.controller.util.ChartTestUtil.java
private void createChart(AbstractPlot plot, SonargraphMetrics metric, int maxDataPoints, boolean hideLegend) { JFreeChart chart = plot.createXYChart(metric, BUILD, maxDataPoints, true); ChartFrame frame1 = new ChartFrame(metric.getShortDescription(), chart); frame1.setVisible(true);/*from w w w . j a v a 2 s . c om*/ frame1.setSize(500, 350); }
From source file:UserInterface.JFreeChartJPanel.java
public JFreeChartJPanel(VitalSign vs, JPanel upc) { initComponents();/*w w w . ja va 2 s. c om*/ this.vs = vs; this.upc = upc; int rr = (vs.getRespiratoryrate()); int hr = vs.getHeartrate(); int bp = vs.getBloodpressure(); double w = vs.getWeight(); DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.setValue(rr, "", "Respiratory Rate"); dataset.setValue(hr, "", "Heart Rate"); dataset.setValue(bp, "", "Blood Pressure"); dataset.setValue(w, "", "Weight"); // org.jfree.chart.JFreeChart chart = ChartFactory.createBarChart("VitalSign", "Vital Signs", "Range", dataset, PlotOrientation.VERTICAL, false, true, false); CategoryPlot plot = chart.getCategoryPlot(); plot.setRangeGridlinePaint(Color.black); ChartFrame frame = new ChartFrame("Bar Chart for _---_", chart); frame.setVisible(true); frame.setSize(600, 600); }
From source file:UserInterface.JFreeChart.java
public JFreeChart(VitalSign vs, JPanel upc) { initComponents();//from w ww.j a v a2s . co m this.vs = vs; this.upc = upc; int rr = (vs.getRespiratoryrate()); int hr = vs.getHeartrate(); int bp = vs.getBloodpressure(); double w = vs.getWeight(); DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.setValue(rr, "", "Respiratory Rate"); dataset.setValue(hr, "", "Heart Rate"); dataset.setValue(bp, "", "Blood Pressure"); dataset.setValue(w, "", "Weight"); // org.jfree.chart.JFreeChart chart = ChartFactory.createBarChart("VitalSign", "Vital Signs", "Range", dataset, PlotOrientation.VERTICAL, false, true, false); CategoryPlot plot = chart.getCategoryPlot(); plot.setRangeGridlinePaint(Color.black); ChartFrame frame = new ChartFrame("Bar Chart for _---_", chart); frame.setVisible(true); frame.setSize(450, 350); }
From source file:userInterface.MonitoringTeamRole.EnvironmentJPanel.java
private void jLabel1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel1MouseClicked // TODO add your handling code here: JFreeChart chart = createChart(createDataset()); chart.setBackgroundPaint(Color.YELLOW); chart.getTitle().setPaint(Color.red); ChartFrame frame = new ChartFrame("XYChart", chart); frame.setVisible(true);//from w w w. j av a 2 s .co m frame.setSize(450, 500); }