Package com.xeiam.xchart

Examples of com.xeiam.xchart.Chart


public class BarChart07 implements ExampleChart {

  public static void main(String[] args) {

    ExampleChart exampleChart = new BarChart07();
    Chart chart = exampleChart.getChart();
    new SwingWrapper(chart).displayChart();
  }
View Full Code Here


  @Override
  public Chart getChart() {

    // Create Chart
    Chart chart = new ChartBuilder().chartType(ChartType.Bar).width(800).height(600).title("Score Histogram").xAxisTitle("Mean").yAxisTitle("Count").build();

    Histogram histogram1 = new Histogram(getGaussianData(1000), 10, -30, 30);
    chart.addSeries("histogram 1", histogram1.getxAxisData(), histogram1.getyAxisData());
    Histogram histogram2 = new Histogram(getGaussianData(1000), 10, -30, 30);
    chart.addSeries("histogram 2", histogram2.getxAxisData(), histogram2.getyAxisData());

    // Customize Chart
    chart.getStyleManager().setLegendPosition(LegendPosition.InsideNW);
    chart.getStyleManager().setBarWidthPercentage(.96);

    return chart;
  }
View Full Code Here

public class LineChart02 implements ExampleChart {

  public static void main(String[] args) {

    ExampleChart exampleChart = new LineChart02();
    Chart chart = exampleChart.getChart();
    new SwingWrapper(chart).displayChart();
  }
View Full Code Here

public class AreaChart02 implements ExampleChart {

  public static void main(String[] args) {

    ExampleChart exampleChart = new AreaChart02();
    Chart chart = exampleChart.getChart();
    new SwingWrapper(chart).displayChart();
  }
View Full Code Here

      xData.add(i - size / 2);
      yData.add(-.000001 * Math.sin(radians));
    }

    // Create Chart
    Chart chart = new Chart(800, 600);

    // Customize Chart
    chart.getStyleManager().setChartTitleVisible(false);
    chart.getStyleManager().setLegendVisible(false);

    // Series 1
    Series series1 = chart.addSeries("y=sin(x)", xData, yData);
    series1.setLineColor(SeriesColor.PURPLE);
    series1.setLineStyle(SeriesLineStyle.DASH_DASH);
    series1.setMarkerColor(SeriesColor.GREEN);
    series1.setMarker(SeriesMarker.SQUARE);

View Full Code Here

  @Override
  public Chart getChart() {

    // Create Chart
    Chart chart = new ChartBuilder().chartType(ChartType.Area).width(800).height(600).title(getClass().getSimpleName()).xAxisTitle("X").yAxisTitle("Y").build();

    List<Integer> xData = new ArrayList<Integer>();
    List<Integer> yData = new ArrayList<Integer>();
    for (int i = 0; i < 5; i++) {
      xData.add(i);
      yData.add(i * i);
    }
    xData.add(5);
    yData.add(null);

    for (int i = 6; i < 10; i++) {
      xData.add(i);
      yData.add(i * i);
    }
    xData.add(10);
    yData.add(null);
    xData.add(11);
    yData.add(100);
    xData.add(12);
    yData.add(90);

    chart.addSeries("a", xData, yData);

    // Customize Chart
    chart.getStyleManager().setLegendPosition(LegendPosition.InsideNW);

    return chart;
  }
View Full Code Here

public class DateChart07 implements ExampleChart {

  public static void main(String[] args) {

    ExampleChart exampleChart = new DateChart07();
    Chart chart = exampleChart.getChart();
    new SwingWrapper(chart).displayChart();
  }
View Full Code Here

  @Override
  public Chart getChart() {

    // Create Chart
    Chart chart = new ChartBuilder().width(800).height(600).title("Year Scale").build();
    chart.getStyleManager().setLegendVisible(false);

    // generate data
    List<Date> xData = new ArrayList<Date>();
    List<Double> yData = new ArrayList<Double>();

    Random random = new Random();

    DateFormat sdf = new SimpleDateFormat("yyyy-MM");
    Date date = null;
    for (int i = 1; i <= 14; i++) {
      try {
        date = sdf.parse("" + (2001 + i) + "-" + random.nextInt(12));
      } catch (ParseException e) {
        e.printStackTrace();
      }
      xData.add(date);
      yData.add(Math.random() * i);
    }

    chart.addSeries("blah", xData, yData);

    return chart;

  }
View Full Code Here

public class BarChart05 implements ExampleChart {

  public static void main(String[] args) {

    ExampleChart exampleChart = new BarChart05();
    Chart chart = exampleChart.getChart();
    new SwingWrapper(chart).displayChart();
  }
View Full Code Here

public class AreaChart01 implements ExampleChart {

  public static void main(String[] args) {

    ExampleChart exampleChart = new AreaChart01();
    Chart chart = exampleChart.getChart();
    new SwingWrapper(chart).displayChart();
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchart.Chart

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.