Example usage for org.jfree.chart ChartFrame setSize

List of usage examples for org.jfree.chart ChartFrame setSize

Introduction

In this page you can find the example usage for org.jfree.chart ChartFrame setSize.

Prototype

public void setSize(int width, int height) 

Source Link

Document

The width and height values are automatically enlarged if either is less than the minimum size as specified by previous call to setMinimumSize .

Usage

From source file:UserInterfaces.HAdministration.SurgeryJPanel.java

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
    // TODO add your handling code here:

    int timeofem = 0;
    int timeofpha = 0;
    int timeofward = 0;
    int timeofor = 0;
    int timeoflab = 0;
    int timeofoutpatient = 0;

    int i;// ww w.  j  a v  a2  s . co  m
    int max = 0;

    for (WorkRequest workRequest : enterprise.getWorkQueue().getWorkRequestList()) {
        if (workRequest.getLevel2().equals(ErrorUtil.SURGERY_OR_ANESTHESIA)) {
            if (workRequest.getLocation().equals(Location.EMERGENCY)) {
                timeofem = timeofem + 1;
            }
            if (workRequest.getLocation().equals(Location.LABORATORY)) {
                timeoflab = timeoflab + 1;
            }
            if (workRequest.getLocation().equals(Location.OR)) {
                timeofor = timeofor + 1;
            }
            if (workRequest.getLocation().equals(Location.OUTPATIEN)) {
                timeofoutpatient = timeofoutpatient + 1;
            }
            if (workRequest.getLocation().equals(Location.PHARMACY)) {
                timeofpha = timeofpha + 1;
            }
            if (workRequest.getLocation().equals(Location.WARD)) {
                timeofward = timeofward + 1;
            }

        }
    }

    int[] numbs;
    numbs = new int[6];
    numbs[0] = timeofem;
    numbs[1] = timeoflab;
    numbs[2] = timeofor;
    numbs[3] = timeofoutpatient;
    numbs[4] = timeofpha;
    numbs[5] = timeofward;

    DefaultPieDataset dataset = new DefaultPieDataset();
    dataset.setValue(Location.EMERGENCY, timeofem);
    dataset.setValue(Location.LABORATORY, timeoflab);
    dataset.setValue(Location.OR, timeofor);
    dataset.setValue(Location.OUTPATIEN, timeofoutpatient);
    dataset.setValue(Location.PHARMACY, timeofpha);
    dataset.setValue(Location.WARD, timeofward);

    JFreeChart chart = ChartFactory.createPieChart(" Chart", dataset, true, true, true);

    PiePlot p = (PiePlot) chart.getPlot();

    ChartFrame chartFrame = new ChartFrame("Location of events", chart);
    chartFrame.setSize(450, 550);
    chartFrame.setVisible(true);
}

From source file:UserInterfaces.HAdministration.SurgeryJPanel.java

private void chartjButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chartjButton1ActionPerformed
    // TODO add your handling code here:

    int timeofadmin = 0;
    int timeofnurse = 0;
    int timeofpathology = 0;
    int timeofphar = 0;
    int timeofphysician = 0;
    int timeofsurgeon = 0;

    for (WorkRequest workRequest : enterprise.getWorkQueue().getWorkRequestList()) {
        if (workRequest.getLevel2().equals(ErrorUtil.SURGERY_OR_ANESTHESIA)) {
            for (ErrorPerson ep : workRequest.getEpd().getErrorpersonlist()) {
                if (ep instanceof AdminstrationErrorPerson) {
                    // if (ep.getEpt().getValue().equals(ErrorPerson.ErrorPersonType.ADMINSTRATION.getValue())) {
                    timeofadmin = timeofadmin + 1;
                }/*from w w w  .j a v a 2  s.  c o m*/
                if (ep instanceof NurseErrorPerson) {
                    timeofnurse = timeofnurse + 1;
                }
                if (ep instanceof PathologistriceErrorPerson) {
                    timeofpathology = timeofpathology + 1;
                }
                if (ep instanceof PharmacistErrorPerson) {
                    timeofphar = timeofphar + 1;
                }
                if (ep instanceof PhysicianErrorPerson) {
                    timeofphysician = timeofphysician + 1;
                }
                if (ep instanceof SurgeonErrorPerson) {
                    timeofsurgeon = timeofsurgeon + 1;
                }

            }
        }
    }

    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    dataset.addValue(timeofadmin, "Adminstration", "Adminstration");
    dataset.addValue(timeofnurse, "Nurse", "Nurse");
    dataset.addValue(timeofpathology, "Pathologist", "Pathologist");
    dataset.addValue(timeofphar, "Pharmacist", "Pharmacist");
    dataset.addValue(timeofphysician, "Physician", "Physician");
    dataset.addValue(timeofsurgeon, "Surgeon", "Surgeon");
    //dataset.setValue(80, "masd", "sss");

    JFreeChart chart = ChartFactory.createBarChart("Personnel", "Position", "Times", dataset,
            PlotOrientation.VERTICAL, false, true, false);
    CategoryPlot plot = chart.getCategoryPlot();
    plot.setRangeGridlinePaint(Color.WHITE);
    ChartFrame frame = new ChartFrame("Chart for ERROR", chart);
    frame.setVisible(true);
    frame.setSize(900, 700);

}

From source file:userInterface.EnergySourceBoardSupervisor.ManageEnergyConsumptionsJPanel.java

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    DefaultPieDataset piedataset = new DefaultPieDataset();
    int rowcount = applianceTable.getRowCount();

    for (int i = 0; i <= rowcount - 1; i++) {
        Sensor sensor = (Sensor) applianceTable.getValueAt(i, 0);
        int j = sensor.getNumberWatt() * sensor.getHours();
        piedataset.setValue(sensor.getSensorType(), j);

    }/*from   ww w .  ja v a  2  s  .c om*/
    JFreeChart freechart = ChartFactory.createPieChart("Pie Chart for Carbon Monoxide Levels", piedataset, true,
            true, Locale.ENGLISH);
    PiePlot plot = (PiePlot) freechart.getPlot();
    ChartFrame frame = new ChartFrame("Pie Chart", freechart);
    frame.setVisible(true);
    frame.setSize(500, 500);
}

From source file:UserInterfaces.HAdministration.FallReportJPanel.java

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
    // TODO add your handling code here:

    int timeofem = 0;
    int timeofpha = 0;
    int timeofward = 0;
    int timeofor = 0;
    int timeoflab = 0;
    int timeofoutpatient = 0;

    int i;/*  w ww .ja v  a2  s. c  o m*/
    int max = 0;

    for (WorkRequest workRequest : enterprise.getWorkQueue().getWorkRequestList()) {
        if (workRequest.getLevel2().equals(ErrorUtil.FALL)) {
            if (workRequest.getLocation().equals(Location.EMERGENCY)) {
                timeofem = timeofem + 1;
            }
            if (workRequest.getLocation().equals(Location.LABORATORY)) {
                timeoflab = timeoflab + 1;
            }
            if (workRequest.getLocation().equals(Location.OR)) {
                timeofor = timeofor + 1;
            }
            if (workRequest.getLocation().equals(Location.OUTPATIEN)) {
                timeofoutpatient = timeofoutpatient + 1;
            }
            if (workRequest.getLocation().equals(Location.PHARMACY)) {
                timeofpha = timeofpha + 1;
            }
            if (workRequest.getLocation().equals(Location.WARD)) {
                timeofward = timeofward + 1;
            }

        }
    }

    int[] numbs;
    numbs = new int[6];
    numbs[0] = timeofem;
    numbs[1] = timeoflab;
    numbs[2] = timeofor;
    numbs[3] = timeofoutpatient;
    numbs[4] = timeofpha;
    numbs[5] = timeofward;

    DefaultPieDataset dataset = new DefaultPieDataset();
    dataset.setValue(Location.EMERGENCY, timeofem);
    dataset.setValue(Location.LABORATORY, timeoflab);
    dataset.setValue(Location.OR, timeofor);
    dataset.setValue(Location.OUTPATIEN, timeofoutpatient);
    dataset.setValue(Location.PHARMACY, timeofpha);
    dataset.setValue(Location.WARD, timeofward);

    JFreeChart chart = ChartFactory.createPieChart(" Chart", dataset, true, true, true);

    PiePlot p = (PiePlot) chart.getPlot();

    ChartFrame chartFrame = new ChartFrame("Location of events", chart);
    chartFrame.setSize(450, 550);
    chartFrame.setVisible(true);

}

From source file:UserInfo_Frame.java

private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
    try {/* w  w w .ja va  2  s .  com*/
        String query = "select date,pressure from UserInfo";
        JDBCCategoryDataset dataset = new JDBCCategoryDataset(javaconnect.ConnectDB(), query);
        JFreeChart chart = ChartFactory.createLineChart("Query Chart", "Date", "Pressure", dataset,
                PlotOrientation.VERTICAL, false, true, true);
        BarRenderer renderer = null;
        CategoryPlot plot = null;
        renderer = new BarRenderer();
        ChartFrame frame = new ChartFrame("Query Chart", chart);
        frame.setVisible(true);
        frame.setSize(400, 650);
    } catch (Exception e) {

    }
}

From source file:UserInterfaces.HAdministration.FallReportJPanel.java

private void chartjButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chartjButton1ActionPerformed
    // TODO add your handling code here:

    int timeofadmin = 0;
    int timeofnurse = 0;
    int timeofpathology = 0;
    int timeofphar = 0;
    int timeofphysician = 0;
    int timeofsurgeon = 0;

    for (WorkRequest workRequest : enterprise.getWorkQueue().getWorkRequestList()) {
        if (workRequest.getLevel2().equals(ErrorUtil.FALL)) {
            for (ErrorPerson ep : workRequest.getEpd().getErrorpersonlist()) {
                if (ep instanceof AdminstrationErrorPerson) {
                    // if (ep.getEpt().getValue().equals(ErrorPerson.ErrorPersonType.ADMINSTRATION.getValue())) {
                    timeofadmin = timeofadmin + 1;
                }/*from   w w  w  .j  a  v  a  2 s .c om*/
                if (ep instanceof NurseErrorPerson) {
                    timeofnurse = timeofnurse + 1;
                }
                if (ep instanceof PathologistriceErrorPerson) {
                    timeofpathology = timeofpathology + 1;
                }
                if (ep instanceof PharmacistErrorPerson) {
                    timeofphar = timeofphar + 1;
                }
                if (ep instanceof PhysicianErrorPerson) {
                    timeofphysician = timeofphysician + 1;
                }
                if (ep instanceof SurgeonErrorPerson) {
                    timeofsurgeon = timeofsurgeon + 1;
                }

            }
        }
    }

    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    dataset.addValue(timeofadmin, "Adminstration", "Adminstration");
    dataset.addValue(timeofnurse, "Nurse", "Nurse");
    dataset.addValue(timeofpathology, "Pathologist", "Pathologist");
    dataset.addValue(timeofphar, "Pharmacist", "Pharmacist");
    dataset.addValue(timeofphysician, "Physician", "Physician");
    dataset.addValue(timeofsurgeon, "Surgeon", "Surgeon");
    //dataset.setValue(80, "masd", "sss");

    JFreeChart chart = ChartFactory.createBarChart("Personnel", "Position", "Times", dataset,
            PlotOrientation.VERTICAL, false, true, false);
    CategoryPlot plot = chart.getCategoryPlot();
    plot.setRangeGridlinePaint(Color.WHITE);
    ChartFrame frame = new ChartFrame("Chart for ERROR", chart);
    frame.setVisible(true);
    frame.setSize(900, 700);

}

From source file:UserInfo_Frame.java

private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
    String pressure = txt_pressure.getText();
    String temperature = txt_temperature.getText();
    String volumeflow = txt_volume.getText();
    String rotationalSpeed = txt_rotationalSpd.getText();

    DefaultPieDataset pieDataset = new DefaultPieDataset();

    pieDataset.setValue("Pressure", new Double(pressure));
    pieDataset.setValue("Temperature", new Double(temperature));
    pieDataset.setValue("Volume Flow", new Double(volumeflow));
    pieDataset.setValue("Rotational Speeed", new Double(rotationalSpeed));

    //JFreeChart chart = ChartFactory.createPieChart("Pie Chart",pieDataset,true,true,true); // create normal piechart
    //PiePlot3D p = (PiePlot)chart.getPlot();
    JFreeChart chart = ChartFactory.createPieChart3D("Parameter Pie Chart", pieDataset, true, true, true);// create 3D piechart
    PiePlot3D p = (PiePlot3D) chart.getPlot();
    //p.setForegroundAlpha(TOP_ALIGNMENT);
    ChartFrame cframe = new ChartFrame("Pie Chart", chart);
    cframe.setVisible(true);/*from w  w w . j a  va 2s. c  om*/
    cframe.setSize(450, 500);
    try {
        //save chart as PNG
        final ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
        final File file1 = new File("chart.png");
        ChartUtilities.saveChartAsPNG(file1, chart, 600, 400, info);
    } catch (Exception e) {

    }

}

From source file:UserInfo_Frame.java

private void barChart_btnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_barChart_btnActionPerformed
    //create dataset values
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();
    dataset.setValue(80, "Marks", "Student1");
    dataset.setValue(50, "Marks", "Student2");
    dataset.setValue(75, "Marks", "Student3");
    dataset.setValue(95, "Marks", "Student4");
    //create bar chart
    JFreeChart chart = ChartFactory.createBarChart("Student Score", "Student Name", "Marks", dataset,
            PlotOrientation.VERTICAL, false, true, true);
    // create Line chart FreeChart chart = ChartFactory.createLineChart("Student Score", "Student Name", "Marks", dataset,PlotOrientation.VERTICAL,false,true,true);
    // set properties
    chart.setBackgroundPaint(Color.YELLOW);// change background color to yellow
    chart.getTitle().setPaint(Color.RED);

    CategoryPlot p = chart.getCategoryPlot();
    p.setRangeGridlinePaint(Color.BLUE);
    ChartFrame bframe = new ChartFrame("Bar Chart for student", chart);
    bframe.setVisible(true);/*from  w w  w.  ja  v a 2s  .  c  o m*/
    bframe.setSize(450, 350);

}

From source file:vinci.project2.pkg1.View.java

/**
 * Initializes the chart/* ww w  .  j  a v  a 2s .co  m*/
 */
private void setChart() {
    final JFreeChart chart = createChart(gd.createDataset(xySeries1, xySeries2, xySeries3));
    ChartPanel chartPanel = new ChartPanel(chart);

    chartPanel.setSize(400, 300);

    ChartFrame chartFrame = new ChartFrame("Taxes", chart);
    chartFrame.setSize(400, 300);

    chartFrame.add(chartPanel);
    chartFrame.pack();
    chartFrame.setVisible(false);

    chartFrame1.add(chartPanel);

    chartFrame1.setSize(400, 300);
    chartFrame1.repaint();
    chartFrame1.revalidate();
}

From source file:statisticslabro.StatisticsLabr.java

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

    List<String> Temp = new ArrayList<String>();
    List<String> check = new ArrayList<String>();
    List<Double> fnl = new ArrayList<>();
    List<String> frame = new ArrayList<String>();
    List<String> name = new ArrayList<String>();
    List<String> name2 = new ArrayList<String>();
    List<Double> frame2 = new ArrayList<Double>();
    List<Double> limitLeft = new ArrayList<>();
    List<Double> limitRight = new ArrayList<>();
    List<Double> trueLimitLeft = new ArrayList<>();
    List<Double> trueLimitRight = new ArrayList<>();
    List<Double> midpoint = new ArrayList<>();
    List<Integer> frequency = new ArrayList<>();
    List<Double> percent = new ArrayList<>();
    List<Integer> cf = new ArrayList<>();
    List<Double> cp = new ArrayList<>();

    Integer freq = 0;/*w  w w.ja v a2 s. c o  m*/
    Double freqtot = 0.0;

    if (Categorical.isSelected() == true && Numerical.isSelected() == false) {
        for (int i = 0; i < jTable1.getRowCount(); i++) {
            frame.add((String) jTable1.getModel().getValueAt(i, 0));
        }
        Collections.sort(frame);

        Integer size = frame.size();
        System.out.println(size);
        for (Object b : frame) {
            String c = b + "";
            Temp.add(c);
        }

        for (int i = 0; i < jTable1.getRowCount(); i++) {
            for (int j = 0; j < jTable1.getColumnCount(); j++) {
                jTable1.setValueAt("", i, j);
            }
        }

        int ct = 0;
        for (Object z : frame) {
            String a = z + "";
            System.out.print(check.contains(a));
            if (!(check.contains(a))) {
                for (int i = 0; i < Temp.size(); i++) {
                    if (a.equals(Temp.get(i))) {
                        freq++;
                    }
                }
                Double freque = (((freq + .0) / size) * 100);
                fnl.add(freque);
                name.add(a);
                freqtot += freque;
                jTable1.getModel().setValueAt(a, ct, 0);
                jTable1.getModel().setValueAt(String.format("%1.1f", freque) + "%", ct, 1);
                ct++;
                freq = 0;

                check.add(a);
            }
            total.setText("Total :" + String.format("%1.1f", freqtot));
        }

        if (Chart.isSelected() == true) {
            DefaultPieDataset chart = new DefaultPieDataset();

            int h = 0;
            for (Double z : fnl) {
                chart.setValue(name.get(h) + "", new Double(z));
                h++;
            }
            JFreeChart mychart = ChartFactory.createPieChart3D(Desc.getText() + "", chart, true, true, true);
            PiePlot3D p = (PiePlot3D) mychart.getPlot();
            ChartFrame charteuFrame = new ChartFrame(Desc.getText(), mychart);
            charteuFrame.setVisible(true);
            charteuFrame.setSize(450, 500);
        }

    } else if (Numerical.isSelected() == true && Categorical.isSelected() == false) {
        double subtrahend = 0.5;

        for (int i = 0; i < jTable1.getRowCount();) {
            double d = Double.parseDouble((String) jTable1.getModel().getValueAt(i, 0));
            frame2.add(d);
            i++;
        }
        double max = 0;
        double min = frame2.get(0);
        for (int j = 0; j < frame2.size(); j++) {
            System.out.print("Sulod");
            if (max < frame2.get(j)) {
                max = frame2.get(j);
            }
            if (min > frame2.get(j)) {
                min = frame2.get(j);
            }
        }

        System.out.print(frame2);
        double range = max - min;
        double k = Math.ceil(1 + 3.322 * Math.log10(frame2.size()));
        int width = (int) Math.ceil(range / k);

        System.out.println("char:   " + max + " " + min + " " + range + " " + k + " width: " + width);
        double limit = min;
        while (limit < max) {
            limitLeft.add(limit);
            limit += width;
        }

        for (int j = 0; j < limitLeft.size(); j++) {
            System.out.print(limitLeft.get(j) + " ");
        }

        double limit2 = min + width - 1;
        while (limit2 <= max) {
            limitRight.add(limit2);
            limit2 += width;
        }

        if (limitRight.get(limitRight.size() - 1) != max) {
            limitRight.add(max);
        }

        System.out.println();
        for (int j = 0; j < limitRight.size(); j++) {
            System.out.print(limitRight.get(j) + " ");
        }

        //true limit
        if (((String) choice.getSelectedItem()).equals("Integer")) {

            for (int j = 0; j < limitLeft.size(); j++) {
                trueLimitLeft.add(limitLeft.get(j) - 0.5);
            }

            System.out.println();
            for (int j = 0; j < trueLimitLeft.size(); j++) {
                System.out.print(trueLimitLeft.get(j) + " ");
            }

            for (int j = 0; j < limitRight.size(); j++) {
                trueLimitRight.add(limitRight.get(j) + 0.5);
            }

            System.out.println();
            for (int j = 0; j < trueLimitRight.size(); j++) {
                System.out.print(trueLimitRight.get(j) + " ");
            }

        } else if (((String) choice.getSelectedItem()).equals("Floating")) {

            int count1 = 0;
            float diff = 0;
            boolean flag = false;

            for (int j = 0; j < frame2.size(); j++) {
                double value = Math.floor(frame2.get(j));
                System.out.println(frame.get(j));
                diff = (float) (frame2.get(j) - value);
                System.out.println("diff: " + diff);
                String counts = String.valueOf(diff);
                if (diff > 0.0) {
                    if (counts.length() - 1 > count1) {
                        count1 = counts.length() - 1;
                        System.out.println(count1);
                    }
                }
            }

            System.out.println(count1);

            for (int j = 0; j < count1 - 1; j++) {
                subtrahend /= 10;
                System.out.println(subtrahend);
            }

            System.out.println("sub: " + subtrahend);
            for (int j = 0; j < limitLeft.size(); j++) {
                trueLimitLeft.add(limitLeft.get(j) - subtrahend);
            }

            for (int j = 0; j < limitRight.size(); j++) {
                trueLimitRight.add(limitRight.get(j) + subtrahend);
            }
        }
        //midpoint
        for (int j = 0; j < limitLeft.size(); j++) {
            midpoint.add((limitLeft.get(j) + limitRight.get(j)) / 2);
        }

        System.out.println();
        for (int j = 0; j < midpoint.size(); j++) {
            System.out.print(midpoint.get(j) + " ");
        }

        //frequency
        for (int j = 0; j < limitLeft.size(); j++) {
            int count = 0;
            for (int m = 0; m < frame2.size(); m++) {
                if (frame2.get(m) >= limitLeft.get(j) && frame2.get(m) <= limitRight.get(j)) {
                    count++;
                }
            }
            frequency.add(count);
        }

        System.out.println();
        for (int j = 0; j < frequency.size(); j++) {
            System.out.print(frequency.get(j) + " ");
        }

        //percent
        for (int j = 0; j < frequency.size(); j++) {
            double pp = (((double) frequency.get(j) / frame2.size()) * 100);
            percent.add(pp);
        }

        System.out.println();
        for (int j = 0; j < percent.size(); j++) {
            System.out.print(percent.get(j) + " ");
        }

        int cff = 0;
        for (int j = 0; j < frequency.size(); j++) {
            cff += frequency.get(j);
            cf.add(cff);
        }

        System.out.println();
        for (int j = 0; j < cf.size(); j++) {
            System.out.print(cf.get(j) + " ");
        }

        double cpp = 0;
        for (int j = 0; j < percent.size(); j++) {
            cpp += percent.get(j);
            cp.add(cpp);
        }

        System.out.println();

        for (int j = 0; j < cp.size(); j++) {
            System.out.print(cp.get(j) + " ");
        }

        DefaultTableModel dtm = (DefaultTableModel) jTable1.getModel();
        dtm.setRowCount(limitLeft.size());

        int ct = 0;
        if (collapse.isSelected() == true) {
            for (int j = 0; j < limitLeft.size(); j++) {
                if (ct == 0) {
                    jTable1.getModel().setValueAt("< " + limitRight.get(j), ct, 1);
                    jTable1.getModel().setValueAt("-", ct, 3);
                    name.add("<");
                } else if (ct == limitLeft.size() - 1) {
                    jTable1.getModel().setValueAt("> " + limitLeft.get(j), ct, 1);
                    jTable1.getModel().setValueAt("-", ct, 3);
                    name.add(">");
                } else {
                    jTable1.getModel().setValueAt(limitLeft.get(j) + "-" + limitRight.get(j), ct, 1);
                    jTable1.getModel().setValueAt(midpoint.get(j), ct, 3);
                    name.add(midpoint.get(j) + "");
                }
                jTable1.getModel().setValueAt(trueLimitLeft.get(j) + "-" + trueLimitRight.get(j), ct, 2);
                jTable1.getModel().setValueAt(frequency.get(j), ct, 4);
                jTable1.getModel().setValueAt(percent.get(j), ct, 5);
                jTable1.getModel().setValueAt(cf.get(j), ct, 6);
                jTable1.getModel().setValueAt(cp.get(j), ct, 7);
                ct++;
            }

        } else {
            for (int j = 0; j < limitLeft.size(); j++) {

                jTable1.getModel().setValueAt(limitLeft.get(j) + "-" + limitRight.get(j), ct, 1);
                jTable1.getModel().setValueAt(trueLimitLeft.get(j) + "-" + trueLimitRight.get(j), ct, 2);
                jTable1.getModel().setValueAt(midpoint.get(j), ct, 3);
                name.add(midpoint.get(j) + "");
                jTable1.getModel().setValueAt(frequency.get(j), ct, 4);
                jTable1.getModel().setValueAt(percent.get(j), ct, 5);
                jTable1.getModel().setValueAt(cf.get(j), ct, 6);
                jTable1.getModel().setValueAt(cp.get(j), ct, 7);
                ct++;
            }
        }

    }

    if (Chart.isSelected() == true) {
        DefaultCategoryDataset chart = new DefaultCategoryDataset();

        int h = 0;
        for (Integer z : frequency) {
            chart.setValue(z, "Frequency", name.get(h));
            h++;
        }
        JFreeChart mychart = ChartFactory.createBarChart(Desc.getText() + "", "Midpoint", "Frequency", chart,
                PlotOrientation.VERTICAL, true, false, false);
        CategoryPlot p = (CategoryPlot) mychart.getPlot();
        p.setDomainGridlinesVisible(true);
        p.getDomainAxis().setCategoryMargin(0.0);
        ChartFrame charteuFrame = new ChartFrame(Desc.getText(), mychart);
        charteuFrame.setVisible(true);
        charteuFrame.setSize(450, 500);
    }
}