Example usage for org.jfree.chart ChartFactory createPieChart3D

List of usage examples for org.jfree.chart ChartFactory createPieChart3D

Introduction

In this page you can find the example usage for org.jfree.chart ChartFactory createPieChart3D.

Prototype

public static JFreeChart createPieChart3D(String title, PieDataset dataset, boolean legend, boolean tooltips,
        boolean urls) 

Source Link

Document

Creates a 3D pie chart using the specified dataset.

Usage

From source file:co.edu.eam.dinesoft.egresados.vista.gui.VentanaReportes.java

private void jCBProgramaRep1ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCBProgramaRep1ItemStateChanged
    // TODO add your handling code here:
    ChartPanel panel;//  w  w  w  .j av  a  2  s.co m
    try {

        Programa programa = (Programa) jCBProgramaRep1.getSelectedItem();

        List<InformacionLaboral> listaInfoLab = controlador.infoLabPro(programa);

        jPGrafica.removeAll();

        double empleado = 0;
        double desempleado = 0;
        double independiente = 0;
        double empresario = 0;

        int contadorEmpleado = 0;
        int contadordDesempleado = 0;
        int contadorIndependiente = 0;
        int contadorEmpresario = 0;

        if (listaInfoLab.size() == 0) {
            JOptionPane.showMessageDialog(null, "No egresados registrados");
        }

        for (InformacionLaboral informacionLaboral : listaInfoLab) {
            if (informacionLaboral.getSituaActual().equals(SituacionActual.EMPLEADO)) {
                contadorEmpleado++;
            } else if (informacionLaboral.getSituaActual().equals(SituacionActual.DESEMPLEADO)) {
                contadordDesempleado++;
            } else if (informacionLaboral.getSituaActual().equals(SituacionActual.INDEPENDIENTE)) {
                contadorIndependiente++;
            } else if (informacionLaboral.getSituaActual().equals(SituacionActual.EMPRESARIO)) {
                contadorEmpresario++;
            }

            empleado = (contadorEmpleado * 100) / listaInfoLab.size();
            desempleado = (contadordDesempleado * 100) / listaInfoLab.size();
            independiente = (contadorIndependiente * 100) / listaInfoLab.size();
            empresario = (contadorEmpresario * 100) / listaInfoLab.size();
        }
        DefaultPieDataset ds = new DefaultPieDataset();
        ds.setValue("EMPLEADO: " + empleado + "%", empleado);
        ds.setValue("DESEMPLEADO: " + desempleado + "%", desempleado);
        ds.setValue("INDEPENDIENTE: " + independiente + "%", independiente);
        ds.setValue("EMPRESARIO: " + empresario + "%", empresario);

        JFreeChart jf = ChartFactory.createPieChart3D("Reporte de egresados por tipo de ocupacin", ds, true,
                true, true);

        panel = new ChartPanel(jf);
        panel.setBounds(20, 50, 720, 350);

        jPGrafica.add(panel);

    } catch (Exception e) {
        // TODO: handle exception
        e.printStackTrace();
    }
}

From source file:co.edu.eam.dinesoft.egresados.vista.gui.VentanaReportes.java

/**
 * Grafica de pastel//  ww w  .  j  a  va 2 s.  c  om
 */
public void reporteEgresadosOcupacion() {
    ChartPanel panel;
    try {
        List<InformacionLaboral> listaInfoLab = controlador.listarInfoLab();

        double empleado = 0;
        double desempleado = 0;
        double independiente = 0;
        double empresario = 0;

        int contadorEmpleado = 0;
        int contadordDesempleado = 0;
        int contadorIndependiente = 0;
        int contadorEmpresario = 0;

        if (listaInfoLab.size() == 0) {
            JOptionPane.showMessageDialog(null, "No hay egresados registrados");
        }

        for (InformacionLaboral informacionLaboral : listaInfoLab) {
            if (informacionLaboral.getSituaActual().equals(SituacionActual.EMPLEADO)) {
                contadorEmpleado++;
            } else if (informacionLaboral.getSituaActual().equals(SituacionActual.DESEMPLEADO)) {
                contadordDesempleado++;
            } else if (informacionLaboral.getSituaActual().equals(SituacionActual.INDEPENDIENTE)) {
                contadorIndependiente++;
            } else if (informacionLaboral.getSituaActual().equals(SituacionActual.EMPRESARIO)) {
                contadorEmpresario++;
            }

            empleado = (contadorEmpleado * 100) / listaInfoLab.size();
            desempleado = (contadordDesempleado * 100) / listaInfoLab.size();
            independiente = (contadorIndependiente * 100) / listaInfoLab.size();
            empresario = (contadorEmpresario * 100) / listaInfoLab.size();
        }
        DefaultPieDataset ds = new DefaultPieDataset();
        ds.setValue("EMPLEADO: " + empleado + "%", empleado);
        ds.setValue("DESEMPLEADO: " + desempleado + "%", desempleado);
        ds.setValue("INDEPENDIENTE: " + independiente + "%", independiente);
        ds.setValue("EMPRESARIO: " + empresario + "%", empresario);

        JFreeChart jf = ChartFactory.createPieChart3D("Reporte de egresados por tipo de ocupacin", ds, true,
                true, true);

        panel = new ChartPanel(jf);
        panel.setBounds(20, 50, 720, 350);

        jPGrafica.add(panel);

    } catch (Exception e) {
        // TODO: handle exception
    }

}

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  o m*/
    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:net.sf.fspdfs.chartthemes.spring.GenericChartTheme.java

/**
 *
 *///from   w  ww. j a va2  s . c o m
protected JFreeChart createPie3DChart() throws JRException {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart = ChartFactory.createPieChart3D(
            (String) evaluateExpression(getChart().getTitleExpression()), (PieDataset) getDataset(),
            isShowLegend(), true, false);

    configureChart(jfreeChart, getPlot());

    PiePlot3D piePlot3D = (PiePlot3D) jfreeChart.getPlot();
    //plot.setStartAngle(290);
    //plot.setDirection(Rotation.CLOCKWISE);
    //plot.setNoDataMessage("No data to display");
    JRPie3DPlot jrPlot = (JRPie3DPlot) getPlot();
    double depthFactor = jrPlot.getDepthFactorDouble() == null ? JRPie3DPlot.DEPTH_FACTOR_DEFAULT
            : jrPlot.getDepthFactorDouble().doubleValue();
    boolean isCircular = jrPlot.getCircular() == null ? false : jrPlot.getCircular().booleanValue();
    piePlot3D.setDepthFactor(depthFactor);
    piePlot3D.setCircular(isCircular);

    PieSectionLabelGenerator labelGenerator = (PieSectionLabelGenerator) getLabelGenerator();
    JRItemLabel itemLabel = jrPlot.getItemLabel();
    if (labelGenerator != null) {
        piePlot3D.setLabelGenerator(labelGenerator);
    } else if (jrPlot.getLabelFormat() != null) {
        piePlot3D.setLabelGenerator(new StandardPieSectionLabelGenerator(jrPlot.getLabelFormat()));
    }
    //      else if (itemLabel != null && itemLabel.getMask() != null)
    //      {
    //         piePlot3D.setLabelGenerator(
    //            new StandardPieSectionLabelGenerator(itemLabel.getMask())
    //            );
    //      }
    else {
        piePlot3D.setLabelGenerator(new StandardPieSectionLabelGenerator());
    }

    if (jrPlot.getLegendLabelFormat() != null) {
        piePlot3D.setLegendLabelGenerator(new StandardPieSectionLabelGenerator(jrPlot.getLegendLabelFormat()));
    }

    Integer baseFontSize = (Integer) getDefaultValue(defaultChartPropertiesMap,
            ChartThemesConstants.BASEFONT_SIZE);
    JRFont font = itemLabel != null && itemLabel.getFont() != null ? itemLabel.getFont() : null;
    piePlot3D.setLabelFont(getFont(new JRBaseFont(getChart(), null), font, baseFontSize));

    if (itemLabel != null && itemLabel.getColor() != null) {
        piePlot3D.setLabelPaint(itemLabel.getColor());
    } else {
        piePlot3D.setLabelPaint(getChart().getForecolor());
    }

    if (itemLabel != null && itemLabel.getBackgroundColor() != null) {
        piePlot3D.setLabelBackgroundPaint(itemLabel.getBackgroundColor());
    } else {
        piePlot3D.setLabelBackgroundPaint(getChart().getBackcolor());
    }

    return jfreeChart;
}

From source file:net.sf.fspdfs.chartthemes.simple.SimpleChartTheme.java

/**
 *
 *//*from  w  w  w .j  av  a 2  s .c o m*/
protected JFreeChart createPie3DChart() throws JRException {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart = ChartFactory.createPieChart3D(
            (String) evaluateExpression(getChart().getTitleExpression()), (PieDataset) getDataset(),
            isShowLegend(), true, false);

    configureChart(jfreeChart, getPlot());

    PiePlot3D piePlot3D = (PiePlot3D) jfreeChart.getPlot();
    //plot.setStartAngle(290);
    //plot.setDirection(Rotation.CLOCKWISE);
    //plot.setNoDataMessage("No data to display");
    JRPie3DPlot jrPlot = (JRPie3DPlot) getPlot();
    double depthFactor = jrPlot.getDepthFactorDouble() == null ? JRPie3DPlot.DEPTH_FACTOR_DEFAULT
            : jrPlot.getDepthFactorDouble().doubleValue();
    boolean isCircular = jrPlot.getCircular() == null ? false : jrPlot.getCircular().booleanValue();
    piePlot3D.setDepthFactor(depthFactor);
    piePlot3D.setCircular(isCircular);

    PieSectionLabelGenerator labelGenerator = (PieSectionLabelGenerator) getLabelGenerator();
    JRItemLabel itemLabel = jrPlot.getItemLabel();
    if (labelGenerator != null) {
        piePlot3D.setLabelGenerator(labelGenerator);
    } else if (jrPlot.getLabelFormat() != null) {
        piePlot3D.setLabelGenerator(new StandardPieSectionLabelGenerator(jrPlot.getLabelFormat()));
    }
    //      else if (itemLabel != null && itemLabel.getMask() != null)
    //      {
    //         piePlot3D.setLabelGenerator(
    //               new StandardPieSectionLabelGenerator(itemLabel.getMask())
    //               );
    //      }

    if (jrPlot.getLegendLabelFormat() != null) {
        piePlot3D.setLegendLabelGenerator(new StandardPieSectionLabelGenerator(jrPlot.getLegendLabelFormat()));
    }

    if (itemLabel != null && itemLabel.getFont() != null) {
        piePlot3D.setLabelFont(JRFontUtil.getAwtFont(itemLabel.getFont(), getLocale()));
    } else {
        piePlot3D.setLabelFont(JRFontUtil.getAwtFont(new JRBaseFont(getChart(), null), getLocale()));
    }

    if (itemLabel != null && itemLabel.getColor() != null) {
        piePlot3D.setLabelPaint(itemLabel.getColor());
    } else {
        piePlot3D.setLabelPaint(getChart().getForecolor());
    }

    if (itemLabel != null && itemLabel.getBackgroundColor() != null) {
        piePlot3D.setLabelBackgroundPaint(itemLabel.getBackgroundColor());
    } else {
        piePlot3D.setLabelBackgroundPaint(getChart().getBackcolor());
    }

    return jfreeChart;
}

From source file:net.sf.jasperreports.chartthemes.spring.GenericChartTheme.java

/**
 *
 *///from  w ww.  j  ava2s .  com
protected JFreeChart createPie3DChart() throws JRException {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart = ChartFactory.createPieChart3D(
            evaluateTextExpression(getChart().getTitleExpression()), (PieDataset) getDataset(), isShowLegend(),
            true, false);

    configureChart(jfreeChart, getPlot());

    PiePlot3D piePlot3D = (PiePlot3D) jfreeChart.getPlot();
    //plot.setStartAngle(290);
    //plot.setDirection(Rotation.CLOCKWISE);
    //plot.setNoDataMessage("No data to display");
    JRPie3DPlot jrPie3DPlot = (JRPie3DPlot) getPlot();
    double depthFactor = jrPie3DPlot.getDepthFactorDouble() == null ? JRPie3DPlot.DEPTH_FACTOR_DEFAULT
            : jrPie3DPlot.getDepthFactorDouble();
    boolean isCircular = jrPie3DPlot.getCircular() == null ? false : jrPie3DPlot.getCircular();
    piePlot3D.setDepthFactor(depthFactor);
    piePlot3D.setCircular(isCircular);

    boolean isShowLabels = jrPie3DPlot.getShowLabels() == null ? true : jrPie3DPlot.getShowLabels();

    if (isShowLabels) {
        PieSectionLabelGenerator labelGenerator = (PieSectionLabelGenerator) getLabelGenerator();
        JRItemLabel itemLabel = jrPie3DPlot.getItemLabel();
        if (labelGenerator != null) {
            piePlot3D.setLabelGenerator(labelGenerator);
        } else if (jrPie3DPlot.getLabelFormat() != null) {
            piePlot3D.setLabelGenerator(new StandardPieSectionLabelGenerator(jrPie3DPlot.getLabelFormat(),
                    NumberFormat.getNumberInstance(getLocale()), NumberFormat.getPercentInstance(getLocale())));
        }
        //      else if (itemLabel != null && itemLabel.getMask() != null)
        //      {
        //         piePlot3D.setLabelGenerator(
        //            new StandardPieSectionLabelGenerator(itemLabel.getMask())
        //            );
        //      }
        else {
            piePlot3D.setLabelGenerator(new StandardPieSectionLabelGenerator());
        }

        Integer baseFontSize = (Integer) getDefaultValue(defaultChartPropertiesMap,
                ChartThemesConstants.BASEFONT_SIZE);
        JRFont font = itemLabel != null && itemLabel.getFont() != null ? itemLabel.getFont() : null;
        piePlot3D.setLabelFont(getFont(new JRBaseFont(getChart(), null), font, baseFontSize));

        if (itemLabel != null && itemLabel.getColor() != null) {
            piePlot3D.setLabelPaint(itemLabel.getColor());
        } else {
            piePlot3D.setLabelPaint(getChart().getForecolor());
        }

        if (itemLabel != null && itemLabel.getBackgroundColor() != null) {
            piePlot3D.setLabelBackgroundPaint(itemLabel.getBackgroundColor());
        } else {
            piePlot3D.setLabelBackgroundPaint(getChart().getBackcolor());
        }
    } else {
        piePlot3D.setLabelGenerator(null);
    }

    if (jrPie3DPlot.getLegendLabelFormat() != null) {
        piePlot3D.setLegendLabelGenerator(new StandardPieSectionLabelGenerator(
                jrPie3DPlot.getLegendLabelFormat(), NumberFormat.getNumberInstance(getLocale()),
                NumberFormat.getPercentInstance(getLocale())));
    }

    return jfreeChart;
}

From source file:Gui.MainGuiBuilder.java

public static void genTop5Gov() {
    top5List = sService.getTop5Gouvernorat();
    dataset = new DefaultPieDataset();
    for (top top5List1 : top5List) {
        dataset.setValue(top5List1.element, top5List1.nb);
    }/*w w  w  .  ja  v  a 2s .com*/
    graphe = ChartFactory.createPieChart3D("Top 5 gouvernorat", dataset, true, true, false);

    piePanel = new ChartPanel(graphe);

    piePanel.setSize(400, 400);

    Statistiques.add(piePanel);

    piePanel.setVisible(true);

    Statistiques.setVisible(true);

}

From source file:net.sf.jasperreports.chartthemes.simple.SimpleChartTheme.java

/**
 *
 *//* w  ww .j a va2s .com*/
protected JFreeChart createPie3DChart() throws JRException {
    ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
    JFreeChart jfreeChart = ChartFactory.createPieChart3D(
            evaluateTextExpression(getChart().getTitleExpression()), (PieDataset) getDataset(), isShowLegend(),
            true, false);

    configureChart(jfreeChart, getPlot());

    PiePlot3D piePlot3D = (PiePlot3D) jfreeChart.getPlot();
    //plot.setStartAngle(290);
    //plot.setDirection(Rotation.CLOCKWISE);
    //plot.setNoDataMessage("No data to display");
    JRPie3DPlot jrPie3DPlot = (JRPie3DPlot) getPlot();
    double depthFactor = jrPie3DPlot.getDepthFactorDouble() == null ? JRPie3DPlot.DEPTH_FACTOR_DEFAULT
            : jrPie3DPlot.getDepthFactorDouble();
    boolean isCircular = jrPie3DPlot.getCircular() == null ? false : jrPie3DPlot.getCircular();
    piePlot3D.setDepthFactor(depthFactor);
    piePlot3D.setCircular(isCircular);

    boolean isShowLabels = jrPie3DPlot.getShowLabels() == null ? true : jrPie3DPlot.getShowLabels();

    if (isShowLabels) {
        PieSectionLabelGenerator labelGenerator = (PieSectionLabelGenerator) getLabelGenerator();
        JRItemLabel itemLabel = jrPie3DPlot.getItemLabel();
        if (labelGenerator != null) {
            piePlot3D.setLabelGenerator(labelGenerator);
        } else if (jrPie3DPlot.getLabelFormat() != null) {
            piePlot3D.setLabelGenerator(new StandardPieSectionLabelGenerator(jrPie3DPlot.getLabelFormat(),
                    NumberFormat.getNumberInstance(getLocale()), NumberFormat.getPercentInstance(getLocale())));
        }
        //      else if (itemLabel != null && itemLabel.getMask() != null)
        //      {
        //         piePlot3D.setLabelGenerator(
        //               new StandardPieSectionLabelGenerator(itemLabel.getMask())
        //               );
        //      }

        if (itemLabel != null && itemLabel.getFont() != null) {
            piePlot3D.setLabelFont(getFontUtil().getAwtFont(itemLabel.getFont(), getLocale()));
        } else {
            piePlot3D.setLabelFont(getFontUtil().getAwtFont(new JRBaseFont(getChart(), null), getLocale()));
        }

        if (itemLabel != null && itemLabel.getColor() != null) {
            piePlot3D.setLabelPaint(itemLabel.getColor());
        } else {
            piePlot3D.setLabelPaint(getChart().getForecolor());
        }

        if (itemLabel != null && itemLabel.getBackgroundColor() != null) {
            piePlot3D.setLabelBackgroundPaint(itemLabel.getBackgroundColor());
        } else {
            piePlot3D.setLabelBackgroundPaint(getChart().getBackcolor());
        }
    } else {
        piePlot3D.setLabelGenerator(null);
    }

    if (jrPie3DPlot.getLegendLabelFormat() != null) {
        piePlot3D.setLegendLabelGenerator(new StandardPieSectionLabelGenerator(
                jrPie3DPlot.getLegendLabelFormat(), NumberFormat.getNumberInstance(getLocale()),
                NumberFormat.getPercentInstance(getLocale())));
    }

    return jfreeChart;
}

From source file:Gui.MainGuiBuilder.java

public static void genTop5User() {
    top5List = sService.getTop5User();
    dataset = new DefaultPieDataset();
    for (top top5List1 : top5List) {
        dataset.setValue(top5List1.element, top5List1.nb);
    }//from  w ww. j  a  va2  s.c om
    graphe = ChartFactory.createPieChart3D("Top 5 user", dataset, true, true, false);
    pie2panel = new ChartPanel(graphe);

    pie2panel.setSize(400, 400);
    pie2panel.setBounds(400, 0, 400, 400);
    Statistiques.add(pie2panel);

    pie2panel.setVisible(true);
    Statistiques.setVisible(true);

}

From source file:jhplot.HChart.java

/**
 * Update the chart//from w  w  w . j a  v  a 2 s  .  c  om
 * 
 * @param N1
 *            location in X
 * @param N2
 *            location in Y
 */
public void update(int N1, int N2) {

    if (cdatPie[N1][N2] != null || cdatPie3D[N1][N2] != null || cdatBar[N1][N2] != null
            || cdatBar3D[N1][N2] != null || cdatLine[N1][N2] != null || cdatArea[N1][N2] != null
            || cdatPolar[N1][N2] != null) {

        if (cdatPie[N1][N2] != null) {
            chart[N1][N2] = ChartFactory.createPieChart(title[N1][N2], (PieDataset) cdatPie[N1][N2], true, true,
                    true);

        } else if (cdatPie3D[N1][N2] != null) {
            chart[N1][N2] = ChartFactory.createPieChart3D(title[N1][N2], (PieDataset) cdatPie3D[N1][N2], true,
                    true, true);
            PiePlot3D pieplot3d = (PiePlot3D) chart[N1][N2].getPlot();
            // pieplot3d.setStartAngle(290D);
            // pieplot3d.setDirection(Rotation.CLOCKWISE);
            // pieplot3d.setForegroundAlpha(0.5F);
            pieplot3d.setBackgroundPaint(DEFAULT_BG_COLOR);

        } else if (cdatBar[N1][N2] != null) {
            chart[N1][N2] = ChartFactory.createBarChart(title[N1][N2], titleX[N1][N2], titleY[N1][N2],
                    (CategoryDataset) cdatBar[N1][N2], PlotOrientation.VERTICAL, true, true, true);
            CategoryPlot lineplot = (CategoryPlot) chart[N1][N2].getPlot();

            CategoryAxis yy = lineplot.getDomainAxis();
            yy.setTickLabelPaint(tickColor);
            yy.setTickLabelFont(tickFont);
            yy.setLabelPaint(labelColor);
            yy.setLabelFont(labelFont);
            yy.setAxisLineStroke(new BasicStroke(axisPenwidth));
            yy.setAxisLinePaint(Color.black);
            ValueAxis xx = lineplot.getRangeAxis();
            xx.setTickLabelPaint(tickColor);
            xx.setTickLabelFont(tickFont);
            xx.setLabelPaint(labelColor);
            xx.setLabelFont(labelFont);
            xx.setAxisLineStroke(new BasicStroke(axisPenwidth));
            xx.setAxisLinePaint(Color.black);

        } else if (cdatBar3D[N1][N2] != null) {
            chart[N1][N2] = ChartFactory.createBarChart3D(title[N1][N2], titleX[N1][N2], titleY[N1][N2],
                    (CategoryDataset) cdatBar3D[N1][N2], PlotOrientation.VERTICAL, true, true, true);
        } else if (cdatLine[N1][N2] != null) {
            chart[N1][N2] = ChartFactory.createLineChart(title[N1][N2], titleX[N1][N2], titleY[N1][N2],
                    (CategoryDataset) cdatLine[N1][N2], PlotOrientation.VERTICAL, true, true, true);
            CategoryPlot lineplot = (CategoryPlot) chart[N1][N2].getPlot();
            lineplot.setOutlineStroke(new BasicStroke(axisPenwidth));
            CategoryAxis yy = lineplot.getDomainAxis();
            yy.setTickLabelPaint(tickColor);
            yy.setTickLabelFont(tickFont);
            yy.setLabelPaint(labelColor);
            yy.setLabelFont(labelFont);
            yy.setAxisLineStroke(new BasicStroke(axisPenwidth));
            yy.setAxisLinePaint(Color.black);
            ValueAxis xx = lineplot.getRangeAxis();
            xx.setTickLabelPaint(tickColor);
            xx.setTickLabelFont(tickFont);
            xx.setLabelPaint(labelColor);
            xx.setLabelFont(labelFont);
            xx.setAxisLineStroke(new BasicStroke(axisPenwidth));
            xx.setAxisLinePaint(Color.black);

            LineAndShapeRenderer renderer = (LineAndShapeRenderer) lineplot.getRenderer();
            renderer.setBaseStroke(new BasicStroke(linestroke));
            for (int m = 0; m < cdatLine[N1][N2].getColumnCount() + 1; m++)
                renderer.setSeriesStroke(m, new BasicStroke(linestroke));

        } else if (cdatPolar[N1][N2] != null) {
            chart[N1][N2] = ChartFactory.createPolarChart(title[N1][N2], (XYSeriesCollection) cdatPolar[N1][N2],
                    true, true, true);
            PolarPlot lineplot = (PolarPlot) chart[N1][N2].getPlot();
            ValueAxis yy = lineplot.getAxis();
            yy.setTickLabelPaint(tickColor);
            yy.setTickLabelFont(tickFont);
            yy.setLabelPaint(labelColor);
            yy.setLabelFont(labelFont);
            yy.setAxisLineStroke(new BasicStroke(axisPenwidth));
            yy.setAxisLinePaint(Color.black);

        } else if (cdatArea[N1][N2] != null) {

            chart[N1][N2] = ChartFactory.createAreaChart(title[N1][N2], titleX[N1][N2], titleY[N1][N2],
                    (CategoryDataset) cdatArea[N1][N2], PlotOrientation.VERTICAL, true, true, true);
            CategoryPlot lineplot = (CategoryPlot) chart[N1][N2].getPlot();

            CategoryAxis yy = lineplot.getDomainAxis();
            yy.setTickLabelPaint(tickColor);
            yy.setTickLabelFont(tickFont);
            yy.setLabelPaint(labelColor);
            yy.setLabelFont(labelFont);
            yy.setAxisLineStroke(new BasicStroke(axisPenwidth));
            yy.setAxisLinePaint(Color.black);
            ValueAxis xx = lineplot.getRangeAxis();
            xx.setTickLabelPaint(tickColor);
            xx.setTickLabelFont(tickFont);
            xx.setLabelPaint(labelColor);
            xx.setLabelFont(labelFont);
            xx.setAxisLineStroke(new BasicStroke(axisPenwidth));
            xx.setAxisLinePaint(Color.black);

        }

        chart[N1][N2].setAntiAlias(antiAlias);
        chart[N1][N2].setBorderPaint(DEFAULT_BG_COLOR);
        chart[N1][N2].setBackgroundPaint(DEFAULT_BG_COLOR);
        chart[N1][N2].setBorderVisible(false);
        cp[N1][N2].setChart(chart[N1][N2]);
        return;
    }

    for (int i = 0; i < indexdat[N1][N2]; i++) {

        if (type[N1][N2].get(i) == "array")
            xyplot[N1][N2].setRenderer(i, (StandardXYItemRenderer) (rdat[N1][N2].get(i)));
        else if (type[N1][N2].get(i) == "f")
            xyplot[N1][N2].setRenderer(i, (XYLineAndShapeRenderer) (rdat[N1][N2].get(i)));
        else if (type[N1][N2].get(i) == "h")
            xyplot[N1][N2].setRenderer(i, (XYBarRenderer) (rdat[N1][N2].get(i)));
        else if (type[N1][N2].get(i) == "p")
            xyplot[N1][N2].setRenderer(i, (XYLineAndShapeRenderer) (rdat[N1][N2].get(i)));
        else if (type[N1][N2].get(i) == "pe")
            xyplot[N1][N2].setRenderer(i, (XYErrorRenderer) (rdat[N1][N2].get(i)));

        // System.out.println(i);

    }

    chart[N1][N2] = new JFreeChart(title[N1][N2], JFreeChart.DEFAULT_TITLE_FONT, xyplot[N1][N2], true);
    chart[N1][N2].setAntiAlias(antiAlias);
    chart[N1][N2].setBorderPaint(DEFAULT_BG_COLOR);
    chart[N1][N2].setBackgroundPaint(DEFAULT_BG_COLOR);
    chart[N1][N2].setBorderVisible(false);

    cp[N1][N2].setChart(chart[N1][N2]);

}