Example usage for java.awt Color YELLOW

List of usage examples for java.awt Color YELLOW

Introduction

In this page you can find the example usage for java.awt Color YELLOW.

Prototype

Color YELLOW

To view the source code for java.awt Color YELLOW.

Click Source Link

Document

The color yellow.

Usage

From source file:bicat.gui.GraphicPane.java

/**
 * Default constructor, initializes some values.
 *///from www .  j  a  va 2 s . c om
public GraphicPane() {

    geneList = null;
    graphDataList = null;
    filledRect = new Rectangle(0, 0);
    xStep = 10;
    yStep = 160; // sta ovo tacno znaci??? (size of the cells of the
    // visualized matrix?)

    colorWheel = new Color[8]; // samo 8?
    colorWheel[0] = Color.BLUE;
    colorWheel[1] = Color.CYAN;
    colorWheel[2] = Color.GREEN;
    colorWheel[3] = Color.MAGENTA;
    colorWheel[4] = Color.ORANGE;
    colorWheel[5] = Color.PINK;
    colorWheel[6] = Color.RED;
    colorWheel[7] = Color.YELLOW;

    //

    /*
     * DefaultPieDataset dpd = new DefaultPieDataset();
     * dpd.setValue("Category 1",50); dpd.setValue("Category 2",50);
     */

    // create a dataset...
    /*
     * DefaultPieDataset data = new DefaultPieDataset();
     * data.setValue("Java", new Double(43.2)); data.setValue("Visual
     * Basic", new Double(0.0)); data.setValue("C/C++", new Double(17.5));
     * 
     * JFreeChart chart = ChartFactory.createPieChart("Sample",data,
     * true,true,false); ChartFrame frame = new ChartFrame("See", chart);
     * frame.pack(); // this.add(frame); //frame.pack();
     * frame.setVisible(true);
     */

    /*
     * chart = ChartFactory.createXYLineChart("Expression Profiles of a
     * Bicluster","genes","conditions", new
     * org.jfree.data.xy.DefaultTableXYDataset(),
     * org.jfree.chart.plot.PlotOrientation.HORIZONTAL, false,false,false);
     * 
     * //ChartPanel cp = new ChartPanel(chart_1); chartPanel = new
     * ChartPanel(chart); this.add(chartPanel); //cp);
     * //,BorderLayout.WEST); this.setVisible(true);
     * //this.add("Proba",chart_1); //ChartFrame frame_1 = new
     * ChartFrame("XY",chart_1); //frame_1.pack();
     * //frame_1.setVisible(true);
     */

}

From source file:GUI.Statistique.java

private void bilanFinanciereParAns() {
    float firstYear = 0;
    float secondYear = 0;
    float thirdYear = 0;
    float forthYear = 0;
    float fiveYear = 0;
    CommandeDAO commandeDAO = new CommandeDAO();
    List<Commande> commandes = new ArrayList<>();
    commandes = commandeDAO.findAll();/*from w  w w. j  av a2s. co  m*/
    for (Commande commande : commandes) {

        if (commande.getDatecommande().getYear() + 1900 == 2016)
            fiveYear += commande.getTotalcommande();
        else if (commande.getDatecommande().getYear() + 1900 == 2015)
            forthYear += commande.getTotalcommande();
        else if (commande.getDatecommande().getYear() + 1900 == 2014)
            thirdYear += commande.getTotalcommande();
        else if (commande.getDatecommande().getYear() + 1900 == 2013)
            secondYear += commande.getTotalcommande();
        else if (commande.getDatecommande().getYear() + 1900 == 2012)
            firstYear += commande.getTotalcommande();
    }
    DefaultCategoryDataset dSet = new DefaultCategoryDataset();
    dSet.addValue(firstYear, "2012", "2012");
    dSet.addValue(secondYear, "2013", "2013");
    dSet.addValue(thirdYear, "2014", "2014");
    dSet.addValue(forthYear, "2015", "2015");
    dSet.addValue(fiveYear, "2016", "2016");

    JFreeChart chart = ChartFactory.createBarChart3D("Rapport financier", "Rvenus", "Montant (DT)", dSet,
            PlotOrientation.VERTICAL, true, true, true);
    chart.setBackgroundPaint(Color.yellow);
    chart.getTitle().setPaint(Color.RED);
    CategoryPlot p = chart.getCategoryPlot();
    p.setRangeGridlinePaint(Color.black);
    ChartPanel cp = new ChartPanel(chart, true, true, true, false, true);
    ChartFrame f = new ChartFrame("try", chart);
    //JFrame f =new JFrame();
    f.setContentPane(cp);
    f.pack();
    //f.setVisible(true);
    // f.setSize(panelRevDep.getWidth()-20,panelRevDep.getHeight()-20);
    // f.setVisible(true);
    // panelRevDep.removeAll();
    //panelRevDep.repaint();
    jPanel3.add(cp);

}

From source file:de.citec.csra.allocation.vis.MovingChart.java

public void updateDataPoints(String id, String label, String resource, long start, long end, State state,
        Priority prio, boolean token) {
    synchronized (this.dataset) {
        TimeSeries series = this.dataset.getSeries(id);
        if (series == null) {
            series = new TimeSeries(id);
            this.dataset.addSeries(series);
        }/*from ww  w  .j a v  a2 s  .  c  om*/

        series.setDomainDescription(label);
        int stroke = -1;
        Color c = null;

        boolean randomcolor = false;
        if (!randomcolor) {
            switch (prio) {
            case EMERGENCY:
                c = Color.RED;
                break;
            case URGENT:
                c = Color.ORANGE;
                break;
            case HIGH:
                c = Color.YELLOW;
                break;
            case NORMAL:
                c = Color.GREEN;
                break;
            case LOW:
                c = Color.BLUE;
                break;
            case NO:
                c = Color.BLACK;
                break;
            }
        }

        switch (state) {
        case REQUESTED:
            stroke = 1;
            break;
        case SCHEDULED:
            stroke = 3;
            break;
        case ALLOCATED:
            stroke = 9;
            break;
        case RELEASED:
            stroke = 1;
            break;
        case REJECTED:
        case CANCELLED:
        case ABORTED:
            c = Color.GRAY;
            stroke = 1;
            break;
        }

        XYLineAndShapeRenderer r = (XYLineAndShapeRenderer) this.chart.getXYPlot()
                .getRendererForDataset(dataset);

        int number = -1;
        for (int i = 0; i < this.dataset.getSeries().size(); i++) {
            TimeSeries t = this.dataset.getSeries(i);
            if (t.getKey().equals(id)) {
                number = i;
            }
        }
        if (number > 0) {
            if (stroke > 0) {
                if (token) {
                    r.setSeriesStroke(number,
                            new BasicStroke(stroke, CAP_BUTT, JOIN_BEVEL, 1, new float[] { 1.5f, .5f }, .5f));
                } else {
                    r.setSeriesStroke(number, new BasicStroke(stroke, CAP_BUTT, JOIN_BEVEL, 1));
                }
            }
            if (c != null) {
                r.setSeriesPaint(number, c);
            }
        }

        long channel;
        String key = resource; //prio
        if (values.containsKey(key)) {
            channel = values.get(key);
        } else {
            channel = events++;
            values.put(key, channel);
        }

        if (!series.isEmpty()) {
            series.clear();
        }
        series.addOrUpdate(new Millisecond(new Date(start)), channel);
        series.addOrUpdate(new Millisecond(new Date(end)), channel);
    }
}

From source file:eu.hydrologis.jgrass.charting.datamodels.MultiXYTimeChartCreator.java

public static void main(String[] args) {
    Display display = new Display();
    Shell shell = new Shell(display);
    shell.setLayout(new GridLayout());

    NumericChartData numericChartData = new NumericChartData(2);

    /*//from w  w  w  .  j ava2 s. co  m
     * first tab
     */
    NumericChartDataItem tab1 = numericChartData.getChartDataItem(0);
    /*
     * title to be taken in the case of composed charts. In that case it is ambiguos which title
     * of which chart should be taken
     */
    tab1.bigTitle = "Title of tab 1";
    /*
     * extra string that will be taken to give the tab a name, the title could be non suitable
     */
    tab1.chartStringExtra = "Text of tab 1";
    /*
     * in tab 1: first chart with 2 series
     */
    // the title for this chart
    tab1.chartTitles.add("Chart title 1 in tab 1");
    // x label
    tab1.chartXLabels.add("X data");
    // y label
    tab1.chartYLabels.add("Y data");
    // define some data
    double[][][] data11 = new double[][][] { { { -1, -2, -3 }, { 2, 4, 6 } }, { { 1, 2, 3 }, { 2, 4, 6 } } };
    tab1.chartSeriesData.add(data11);
    // give the series for this chart a name
    tab1.seriesNames.add(new String[] { "series 1", "series 2" });
    /*
     * in tab 1: second chart with 1 serie
     */
    tab1.seriesNames.add(new String[] { "series 1" });
    double[][][] data12 = new double[][][] { { { 1, 2, 3 }, { 2, 4, 6 } } };
    tab1.chartTitles.add("Chart title 2 in tab 1");
    tab1.chartXLabels.add("X data");
    tab1.chartYLabels.add("Y data");
    tab1.chartSeriesData.add(data12);

    /*
     * second tab
     */
    NumericChartDataItem tab2 = numericChartData.getChartDataItem(1);
    tab2.bigTitle = "Title of tab 2";
    tab2.chartStringExtra = "Text of tab 2";
    /*
     * in tab 2: one single chart with 3 series
     */
    tab2.chartTitles.add("Chart title 1 in tab 2");
    tab2.chartXLabels.add("X data");
    tab2.chartYLabels.add("Y data");
    double[][][] data2 = new double[][][] { { { -1, -2, -3 }, { 2, 4, 6 } }, { { 1, 2, 3 }, { 2, 4, 6 } },
            { { 1, 2, 3 }, { -2, -4, -6 } } };
    tab2.chartSeriesData.add(data2);
    tab2.seriesNames.add(new String[] { "series 1", "series 2", "series 3" });

    /*
     * create the chart using a
     */
    ChartCreator creator = new MultiXYTimeChartCreator();
    // tweak some stuff
    /* create all the charts in the list for every tab? Yes. */
    creator.M_HINT_CREATE_CHART = new boolean[][] { { true, true }, { true, false } };
    /* create the checkboxes to hide and unhide the series? First no, second yes */
    creator.M_HINT_CREATE_TOGGLEHIDESERIES = new boolean[][] { { false, false }, { true, false } };
    /* define the types of chart to create */
    creator.M_HINT_CHART_TYPE = new int[][] { { ChartCreator.XYBARCHART, ChartCreator.XYLINECHART },
            { ChartCreator.XYLINECHART, -1 } };
    /* define the vertical orientation of the chart */
    creator.M_HINT_CHARTORIENTATION_UP = new boolean[][] { { false, true }, { true, true } };
    /*
     * define the colors of the series, if = null, colors are taken automatically
     */
    creator.M_HINT_CHARTSERIESCOLOR = new Color[2][2][3];
    // tab 1, chart 1, all series
    creator.M_HINT_CHARTSERIESCOLOR[0][0] = new Color[] { Color.blue, Color.red, null };
    // tab 1, chart 2, all series
    creator.M_HINT_CHARTSERIESCOLOR[0][1] = new Color[] { Color.green, null, null };
    // tab 2, chart 1, all series
    creator.M_HINT_CHARTSERIESCOLOR[1][0] = new Color[] { Color.blue, Color.red, Color.yellow };

    /*
     * finally create that plot
     */
    creator.makePlot(shell, numericChartData);

    shell.pack();
    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
    display.dispose();
}

From source file:net.sf.firemox.clickable.target.card.CardFactory.java

/**
 * Save writable string settings of cards
 *//*w  w w  .j  a v a2s  .c  o  m*/
public static void saveSettings() {
    if (Color.WHITE.equals(borderColor)) {
        borderColor = Color.WHITE;
        Configuration.setProperty("border-color", "white");
    } else if (Color.YELLOW.darker().darker().equals(borderColor)) {
        Configuration.setProperty("border-color", "gold");
    } else if (Color.BLACK.equals(borderColor)) {
        Configuration.setProperty("border-color", "black");
    } else {
        // Auto
        Configuration.setProperty("border-color", "auto");
    }
}

From source file:gui.MainGUI.java

private JFreeChart createKnowledgeChart(RealAgent agent[]) {
    XYSeriesCollection xyDataset = new XYSeriesCollection();
    JFreeChart chart = ChartFactory.createXYLineChart("Agent knowledge", // Title
            "Time", // X-Axis label
            "% map known", // Y-Axis label
            xyDataset, // Dataset
            PlotOrientation.VERTICAL, true, // Show legend
            true, // Tooltips
            false);//w ww .  jav a2s . c o  m
    for (int i = 0; i < agent.length; i++) {
        //update agent data
        //agent[i].updateTrueAreaKnown(simConfig.getEnv());
        agent[i].knowledgeData.put(simulation.getTimeElapsed(),
                (double) agent[i].getAreaKnown() / (double) simulation.getTotalArea());

        XYSeries series = new XYSeries("Agent " + i);
        Iterator it = agent[i].knowledgeData.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry<Integer, Double> pairs = (Map.Entry) it.next();

            series.add(pairs.getKey(), pairs.getValue());
        }
        xyDataset.addSeries(series);
    }
    jointKnowledge.put(simulation.getTimeElapsed(),
            (double) simulation.getTrueJointAreaKnown() / (double) simulation.getTotalArea());
    XYSeries series = new XYSeries("Joint agent knowledge");
    Iterator it = jointKnowledge.entrySet().iterator();
    while (it.hasNext()) {
        Map.Entry<Integer, Double> pairs = (Map.Entry) it.next();

        series.add(pairs.getKey(), pairs.getValue());
    }
    xyDataset.addSeries(series);
    chart.setBackgroundPaint(Color.white);
    chart.getPlot().setBackgroundPaint(Color.black);
    chart.getPlot().setForegroundAlpha(1f);
    chart.getXYPlot().getRenderer().setSeriesPaint(0, Color.RED);
    chart.getXYPlot().getRenderer().setSeriesStroke(0, new BasicStroke(5));
    chart.getXYPlot().getRenderer().setSeriesPaint(1, Color.BLUE);
    chart.getXYPlot().getRenderer().setSeriesPaint(2, Color.YELLOW);
    chart.getXYPlot().getRenderer().setSeriesPaint(3, Color.GREEN);
    chart.getXYPlot().getRenderer().setSeriesPaint(4, Color.cyan);
    chart.getXYPlot().getRenderer().setSeriesPaint(agent.length, Color.MAGENTA);
    chart.getXYPlot().getRenderer().setSeriesStroke(agent.length, new BasicStroke(3));
    return chart;
}

From source file:sentimentanalyzer.ChartController.java

public Color getRandomColor() {
    Color[] picker = new Color[10];
    picker[0] = Color.ORANGE;/*from   w  ww . ja v  a2 s.  c  o m*/
    picker[1] = Color.BLUE;
    picker[2] = Color.GREEN;
    picker[3] = Color.YELLOW;
    picker[4] = Color.BLACK;
    picker[5] = Color.PINK;
    picker[6] = Color.CYAN;
    picker[7] = Color.MAGENTA;
    picker[8] = Color.RED;
    picker[9] = Color.GRAY;

    int index = new Random().nextInt(picker.length);
    return picker[index];
}

From source file:com.bdb.weather.display.day.DayXYPlotPane.java

/**
 * Add the sunrise and sunset markers to the plot.
 *///from  w  w  w .  j a  v a 2  s . c o m
private void addSunriseSunsetMarkers() {
    plot.clearDomainMarkers();

    //
    // If the menu item is currently selected
    //
    if (!displayDayNightIndicators)
        return;

    IntervalMarker marker = new IntervalMarker((double) TimeUtils.localDateTimeToEpochMillis(sunrise),
            (double) TimeUtils.localDateTimeToEpochMillis(sunset));
    Color color = new Color(Color.YELLOW.getRed(), Color.YELLOW.getGreen(), Color.YELLOW.getBlue(), 60);
    marker.setPaint(color);

    plot.addDomainMarker(marker);
}

From source file:de.tor.tribes.ui.algo.TimeFrameVisualizer.java

private void renderDayMarkers(long pStart, long pEnd, Graphics2D pG2D) {
    Date d = new Date(pStart);
    d = DateUtils.setHours(d, 0);//from   www  .  j  a va  2 s.  co m
    d = DateUtils.setMinutes(d, 0);
    d = DateUtils.setSeconds(d, 0);
    d = DateUtils.setMilliseconds(d, 0);

    for (long mark = d.getTime(); mark <= pEnd; mark += DateUtils.MILLIS_PER_HOUR) {
        int markerPos = Math.round((mark - pStart) / DateUtils.MILLIS_PER_MINUTE);
        pG2D.setColor(Color.YELLOW);
        pG2D.fillRect(markerPos, 20, 2, 10);
        pG2D.setColor(Color.WHITE);
        pG2D.setFont(pG2D.getFont().deriveFont(Font.BOLD, 10.0f));
        pG2D.fillRect(markerPos - 5, 15, 12, 10);
        pG2D.setColor(Color.BLACK);
        Calendar cal = Calendar.getInstance();
        cal.setTime(new Date(mark));
        NumberFormat f = NumberFormat.getNumberInstance();
        f.setMinimumIntegerDigits(2);
        f.setMaximumFractionDigits(2);
        pG2D.drawString(f.format(cal.get(Calendar.HOUR_OF_DAY)), markerPos - 5, 23);
    }

    long currentDay = d.getTime();
    while (currentDay < pEnd) {
        currentDay += DateUtils.MILLIS_PER_DAY;
        int markerPos = Math.round((currentDay - pStart) / DateUtils.MILLIS_PER_MINUTE);
        pG2D.setColor(new Color(123, 123, 123));
        pG2D.fillRect(markerPos, 15, 3, 30);
        SimpleDateFormat f = new SimpleDateFormat("dd.MM.yy");
        String dayLabel = f.format(currentDay);
        Rectangle2D labelBounds = pG2D.getFontMetrics().getStringBounds(dayLabel, pG2D);
        pG2D.setColor(Color.YELLOW);
        int labelWidth = (int) labelBounds.getWidth() + 5;
        pG2D.fillRect(markerPos - (int) Math.rint(labelWidth / 2), 15, labelWidth, 10);
        pG2D.setColor(Color.BLACK);
        pG2D.setFont(pG2D.getFont().deriveFont(Font.BOLD, 10.0f));
        pG2D.drawString(dayLabel, markerPos - (int) Math.rint(labelWidth / 2) + 2, 23);
    }
}

From source file:cs.stats.gui.StatsCharts.java

private ChartPanel createChart(String axisLabel, int type) {
    int width = (screenSize.width - (screenSize.width / 35));
    int height = (int) (screenSize.height - (screenSize.height / (double) 4));

    //int width = (screenSize.width - (screenSize.width / 35)) / 2;
    //int height = (int) (screenSize.height - (screenSize.height / (double) 4)) / 2;

    lastValue = new double[SUBPLOT_COUNT];
    //================= visualise standard chart ==========================
    CombinedDomainXYPlot combineddomainxyplot = new CombinedDomainXYPlot(new DateAxis("Time"));

    lastValue[0] = 100D;//from w  w  w .  j  a v  a 2 s. c om
    TimeSeries timeseries = null;
    XYPlot xyplot = null;

    //add new timeseries to modularity row
    datasets[type] = new TimeSeriesCollection();

    NumberAxis numberaxis = new NumberAxis(axisLabel);
    numberaxis.setAutoRangeIncludesZero(true);

    //fast
    StandardXYItemRenderer xyItemRender = new StandardXYItemRenderer();
    //original
    //xyItemRender = new StandardXYItemRenderer();

    xyItemRender.setSeriesStroke(0,
            new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0));
    xyItemRender.setSeriesStroke(1,
            new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0));
    xyItemRender.setSeriesStroke(2,
            new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0));
    xyItemRender.setSeriesStroke(3,
            new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0));
    xyItemRender.setSeriesStroke(4,
            new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0));
    xyItemRender.setSeriesStroke(5,
            new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0));
    xyItemRender.setSeriesStroke(6,
            new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0));
    xyItemRender.setSeriesStroke(7,
            new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0));
    xyItemRender.setSeriesStroke(8,
            new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0));
    xyItemRender.setSeriesStroke(9,
            new BasicStroke(lineThickness, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, null, 0));

    //TODO colours need to be defined statically before the renderer is created!
    xyplot = new XYPlot(datasets[type], null, numberaxis, xyItemRender);

    switch (type) {
    case 0: {
        xyItemRender.setSeriesPaint(0, Color.BLACK);
        timeseries = new TimeSeries("Reply rate 1.0", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);

        xyItemRender.setSeriesPaint(1, Color.BLUE);
        timeseries = new TimeSeries("Reply rate 0.9", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);

        xyItemRender.setSeriesPaint(2, Color.ORANGE);
        timeseries = new TimeSeries("Reply rate 0.8", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);

        xyItemRender.setSeriesPaint(3, Color.GREEN);
        timeseries = new TimeSeries("Reply rate 0.7", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);

        xyItemRender.setSeriesPaint(4, Color.MAGENTA);
        timeseries = new TimeSeries("Reply rate 0.6", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);

        xyItemRender.setSeriesPaint(5, Color.LIGHT_GRAY);
        timeseries = new TimeSeries("Reply rate 0.5", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);

        xyItemRender.setSeriesPaint(6, Color.YELLOW);
        timeseries = new TimeSeries("Reply rate 0.4", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);

        //            xyItemRender.setSeriesPaint(7, Color.PINK);
        //            timeseries = new TimeSeries("Reply rate 0.3", org.jfree.data.time.Hour.class);
        //            datasets[type].addSeries(timeseries);
        //
        //            xyItemRender.setSeriesPaint(8, Color.RED);
        //            timeseries = new TimeSeries("Reply rate 0.2", org.jfree.data.time.Hour.class);
        //            datasets[type].addSeries(timeseries);
        //
        //            xyItemRender.setSeriesPaint(9, Color.CYAN);
        //            timeseries = new TimeSeries("Reply rate 0.1", org.jfree.data.time.Hour.class);
        //            datasets[type].addSeries(timeseries);
    }
        break;
    case 1: {
        xyItemRender.setSeriesPaint(0, Color.BLACK);
        timeseries = new TimeSeries("0% of community users removed", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);

        xyItemRender.setSeriesPaint(1, Color.BLUE);
        timeseries = new TimeSeries("1% of community users removed", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);

        xyItemRender.setSeriesPaint(2, Color.ORANGE);
        timeseries = new TimeSeries("2% of community users removed", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);

        xyItemRender.setSeriesPaint(3, Color.GREEN);
        timeseries = new TimeSeries("3% of community users removed", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);

        xyItemRender.setSeriesPaint(4, Color.MAGENTA);
        timeseries = new TimeSeries("3.5% of community users removed", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);

        xyItemRender.setSeriesPaint(5, Color.LIGHT_GRAY);
        timeseries = new TimeSeries("4% of community users removed", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);

        xyItemRender.setSeriesPaint(6, Color.YELLOW);
        timeseries = new TimeSeries("4.5% of community users removed", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);

        xyItemRender.setSeriesPaint(7, Color.PINK);
        timeseries = new TimeSeries("5% of community users removed", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);

        xyItemRender.setSeriesPaint(8, Color.RED);
        timeseries = new TimeSeries("5.5% of community users removed", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);

        xyItemRender.setSeriesPaint(9, Color.CYAN);
        timeseries = new TimeSeries("6% of community users removed", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);
    }
        break;
    case 2: {
        xyItemRender.setSeriesPaint(0, Color.GRAY);
        timeseries = new TimeSeries("Average number of thread replies (per hour)",
                org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);
    }
        break;
    case 3: {
        xyItemRender.setSeriesPaint(0, Color.GREEN);
        timeseries = new TimeSeries("New thread arrival activity change (%)", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);
        xyItemRender.setSeriesPaint(1, Color.BLUE);
        timeseries = new TimeSeries("Thread reply activity change (%)", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);
    }
        break;
    case 4: {
        xyItemRender.setSeriesPaint(0, Color.GREEN);
        timeseries = new TimeSeries("Mean thread aswer time", org.jfree.data.time.Hour.class);
        datasets[type].addSeries(timeseries);
    }
        break;
    }

    NumberAxis rangeAxis = (NumberAxis) xyplot.getRangeAxis();
    //rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
    rangeAxis.setTickUnit(new NumberTickUnit(0.1));

    xyplot.setBackgroundPaint(Color.lightGray);
    xyplot.setDomainGridlinePaint(Color.white);
    xyplot.setRangeGridlinePaint(Color.white);
    combineddomainxyplot.add(xyplot);

    ChartPanel chart = null;

    switch (type) {
    case 0: {
        jfreechart1 = new JFreeChart("", combineddomainxyplot);
        LegendTitle legendtitle = (LegendTitle) jfreechart1.getSubtitle(0);

        //set legend fonts
        jfreechart1.getLegend(0).setItemFont(new Font("Italic", Font.PLAIN, 11));

        legendtitle.setPosition(RectangleEdge.BOTTOM);
        legendtitle.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0.0D, 4D, 0.0D, 4D));
        jfreechart1.setBorderPaint(Color.black);
        jfreechart1.setBorderVisible(true);
        jfreechart1.setBackgroundPaint(Color.white);
        combineddomainxyplot.setBackgroundPaint(Color.lightGray);
        combineddomainxyplot.setDomainGridlinePaint(Color.white);
        combineddomainxyplot.setRangeGridlinePaint(Color.white);
        combineddomainxyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D));

        valueAxis1 = combineddomainxyplot.getDomainAxis();

        dateAxis1 = (DateAxis) valueAxis1;
        dateAxis1.setTickUnit(new DateTickUnit(1, 1));

        if (scope1 == 0) {
            valueAxis1.setAutoRange(true);
        } else {
            valueAxis1.setFixedAutoRange(scope1);
        }

        chart = new ChartPanel(jfreechart1);
        chart.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        //chart.add(buildPlotDisplayManagementPanel(valueAxis1, dateAxis1, ddlScope1));
        combineddomainxyplot.setInsets(new RectangleInsets(40, 25, 0, 10));
        chart.setPreferredSize(new Dimension(width, height));

        jfreechart1.setAntiAlias(false);
    }
        break;
    case 1: {

        jfreechart2 = new JFreeChart("", combineddomainxyplot);
        LegendTitle legendtitle = (LegendTitle) jfreechart2.getSubtitle(0);

        //set legend fonts
        jfreechart2.getLegend(0).setItemFont(new Font("Italic", Font.PLAIN, 11));

        legendtitle.setPosition(RectangleEdge.BOTTOM);
        legendtitle.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0.0D, 4D, 0.0D, 4D));
        jfreechart2.setBorderPaint(Color.black);
        jfreechart2.setBorderVisible(true);
        jfreechart2.setBackgroundPaint(Color.white);
        combineddomainxyplot.setBackgroundPaint(Color.lightGray);
        combineddomainxyplot.setDomainGridlinePaint(Color.white);
        combineddomainxyplot.setRangeGridlinePaint(Color.white);
        combineddomainxyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D));

        valueAxis2 = combineddomainxyplot.getDomainAxis();
        dateAxis2 = (DateAxis) valueAxis2;
        dateAxis2.setTickUnit(new DateTickUnit(1, 1));

        if (scope2 == 0) {
            valueAxis2.setAutoRange(true);
        } else {
            valueAxis2.setFixedAutoRange(scope2);
        }

        chart = new ChartPanel(jfreechart2);
        chart.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        combineddomainxyplot.setInsets(new RectangleInsets(40, 25, 0, 10));
        chart.setPreferredSize(new Dimension(width, height));

        jfreechart2.setAntiAlias(false);
    }
        break;
    case 2: {

        jfreechart3 = new JFreeChart("", combineddomainxyplot);
        LegendTitle legendtitle = (LegendTitle) jfreechart3.getSubtitle(0);

        //set legend fonts
        jfreechart3.getLegend(0).setItemFont(new Font("Italic", Font.PLAIN, 11));

        legendtitle.setPosition(RectangleEdge.BOTTOM);
        legendtitle.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0.0D, 4D, 0.0D, 4D));
        jfreechart3.setBorderPaint(Color.black);
        jfreechart3.setBorderVisible(true);
        jfreechart3.setBackgroundPaint(Color.white);
        combineddomainxyplot.setBackgroundPaint(Color.lightGray);
        combineddomainxyplot.setDomainGridlinePaint(Color.white);
        combineddomainxyplot.setRangeGridlinePaint(Color.white);
        combineddomainxyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D));

        valueAxis3 = combineddomainxyplot.getDomainAxis();
        dateAxis3 = (DateAxis) valueAxis3;

        if (scope3 == 0) {
            valueAxis3.setAutoRange(true);
        } else {
            valueAxis3.setFixedAutoRange(scope3);
        }

        chart = new ChartPanel(jfreechart3);
        chart.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        chart.add(buildPlotDisplayManagementPanel(valueAxis3, dateAxis3, ddlScope3));
        combineddomainxyplot.setInsets(new RectangleInsets(40, 25, 0, 10));
        chart.setPreferredSize(new Dimension(width, height));

        jfreechart3.setAntiAlias(false);
    }
        break;
    case 3: {
        jfreechart4 = new JFreeChart("", combineddomainxyplot);
        LegendTitle legendtitle = (LegendTitle) jfreechart4.getSubtitle(0);

        //set legend fonts
        jfreechart4.getLegend(0).setItemFont(new Font("Italic", Font.PLAIN, 11));

        legendtitle.setPosition(RectangleEdge.BOTTOM);
        legendtitle.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0.0D, 4D, 0.0D, 4D));
        jfreechart4.setBorderPaint(Color.black);
        jfreechart4.setBorderVisible(true);
        jfreechart4.setBackgroundPaint(Color.white);
        combineddomainxyplot.setBackgroundPaint(Color.lightGray);
        combineddomainxyplot.setDomainGridlinePaint(Color.white);
        combineddomainxyplot.setRangeGridlinePaint(Color.white);
        combineddomainxyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D));

        valueAxis4 = combineddomainxyplot.getDomainAxis();
        dateAxis4 = (DateAxis) valueAxis4;

        if (scope4 == 0) {
            valueAxis4.setAutoRange(true);
        } else {
            valueAxis4.setFixedAutoRange(scope4);
        }

        chart = new ChartPanel(jfreechart4);
        chart.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        chart.add(buildPlotDisplayManagementPanel(valueAxis4, dateAxis4, ddlScope4));
        combineddomainxyplot.setInsets(new RectangleInsets(40, 25, 0, 10));
        chart.setPreferredSize(new Dimension(width, height));

        jfreechart4.setAntiAlias(false);
    }
        break;
    case 4: {
        jfreechart5 = new JFreeChart("", combineddomainxyplot);
        LegendTitle legendtitle = (LegendTitle) jfreechart5.getSubtitle(0);

        //set legend fonts
        jfreechart5.getLegend(0).setItemFont(new Font("Italic", Font.PLAIN, 11));

        legendtitle.setPosition(RectangleEdge.BOTTOM);
        legendtitle.setMargin(new RectangleInsets(UnitType.ABSOLUTE, 0.0D, 4D, 0.0D, 4D));
        jfreechart5.setBorderPaint(Color.black);
        jfreechart5.setBorderVisible(true);
        jfreechart5.setBackgroundPaint(Color.white);
        combineddomainxyplot.setBackgroundPaint(Color.lightGray);
        combineddomainxyplot.setDomainGridlinePaint(Color.white);
        combineddomainxyplot.setRangeGridlinePaint(Color.white);
        combineddomainxyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D));

        valueAxis5 = combineddomainxyplot.getDomainAxis();
        dateAxis5 = (DateAxis) valueAxis5;

        if (scope5 == 0) {
            valueAxis5.setAutoRange(true);
        } else {
            valueAxis5.setFixedAutoRange(scope5);
        }

        chart = new ChartPanel(jfreechart5);
        chart.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        chart.add(buildPlotDisplayManagementPanel(valueAxis5, dateAxis5, ddlScope5));
        combineddomainxyplot.setInsets(new RectangleInsets(40, 25, 0, 10));
        chart.setPreferredSize(new Dimension(width, height));

        jfreechart5.setAntiAlias(false);
    }
        break;
    }

    return chart;

}