/**
 * Copyright 2015 Knowm Inc. (http://knowm.org) and contributors.
 * Copyright 2011-2015 Xeiam LLC (http://xeiam.com) and contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.knowm.xchart.demo.charts.bar;

import java.util.ArrayList;
import java.util.Arrays;

import org.knowm.xchart.Chart;
import org.knowm.xchart.ChartBuilder;
import org.knowm.xchart.StyleManager.ChartTheme;
import org.knowm.xchart.StyleManager.ChartType;
import org.knowm.xchart.SwingWrapper;
import org.knowm.xchart.demo.charts.ExampleChart;

/**
 * GGPlot2 Theme
 * <p>
 * Demonstrates the following:
 * <ul>
 * <li>String categories
 * <li>Positive and negative values
 * <li>Multiple series
 */
public class BarChart05 implements ExampleChart {

  public static void main(String[] args) {

    ExampleChart exampleChart = new BarChart05();
    Chart chart = exampleChart.getChart();
    new SwingWrapper(chart).displayChart();
  }

  @Override
  public Chart getChart() {

    // Create Chart
    Chart chart = new ChartBuilder().chartType(ChartType.Bar).width(800).height(600).title("Temperature vs. Color").xAxisTitle("Color").yAxisTitle("Temperature").theme(ChartTheme.GGPlot2).build();
    chart.addCategorySeries("fish", new ArrayList<String>(Arrays.asList(new String[] { "Blue", "Red", "Green", "Yellow", "Yellow" })), new ArrayList<Number>(Arrays.asList(new Number[] { -40, 30, 20,
        60, 60 })));
    chart.addCategorySeries("worms", new ArrayList<String>(Arrays.asList(new String[] { "Blue", "Red", "Green", "Yellow", "Yellow" })), new ArrayList<Number>(Arrays.asList(new Number[] { 50, 10, -20,
        40, 60 })));

    return chart;
  }
}

@@ -1811,38 +1811,38 @@
 en%22, %22Yellow%22, %22
-Yellow
+Orange
 %22 %7D)), new Array
@@ -2044,99 +2044,764 @@
 %22, %22
-Yellow%22 %7D)), new ArrayList%3CNumber%3E(Arrays.asList(new Number%5B%5D %7B 50, 10, -20,%0A        40, 60
+Orange%22 %7D)), new ArrayList%3CNumber%3E(Arrays.asList(new Number%5B%5D %7B 50, 10, -20,%0A        40, 60 %7D)));%0A    chart.addCategorySeries(%22birds%22, new ArrayList%3CString%3E(Arrays.asList(new String%5B%5D %7B %22Blue%22, %22Red%22, %22Green%22, %22Yellow%22, %22Orange%22 %7D)), new ArrayList%3CNumber%3E(Arrays.asList(new Number%5B%5D %7B 13, 22, -23,%0A        -34, 37 %7D)));%0A    chart.addCategorySeries(%22ants%22, new ArrayList%3CString%3E(Arrays.asList(new String%5B%5D %7B %22Blue%22, %22Red%22, %22Green%22, %22Yellow%22, %22Orange%22 %7D)), new ArrayList%3CNumber%3E(Arrays.asList(new Number%5B%5D %7B 50, 57, -14,%0A        -20, 31 %7D)));%0A    chart.addCategorySeries(%22slugs%22, new ArrayList%3CString%3E(Arrays.asList(new String%5B%5D %7B %22Blue%22, %22Red%22, %22Green%22, %22Yellow%22, %22Orange%22 %7D)), new ArrayList%3CNumber%3E(Arrays.asList(new Number%5B%5D %7B -2, 29, 49,%0A        -16, -43
  %7D))

update ggplot2 bar chart