Package jofc2.model

Examples of jofc2.model.Chart




  @SuppressWarnings("unchecked")
  protected Element createBar(OFC ofc, int s) {
    FilledBarChart e = new FilledBarChart();

    // TODO Create the property OutlineColour
    e.setOutlineColour("#577261");
    if (ofc.getPallete() != null) {
      e.setColour(ofc.getPallete()[s]);
    } else {
      e.setColour("#E2D66A");
    }
    Comparable serie = model.getSeries(s);
    e.setText((String) serie);
    List<Number> values = new ArrayList<Number>();
    for (Iterator itCategories = model.getCategories().iterator(); itCategories
        .hasNext();) {
      Comparable category = (Comparable) itCategories.next();
      Number n = model.getValue(serie, category);
      if (n.doubleValue() < minValue) {
        minValue = n.doubleValue();
      }
      if (n.doubleValue() > maxValue) {
        maxValue = n.doubleValue();
      }
      values.add(n);
    }
    e.addValues(values);
    return e;
  }
View Full Code Here


   *
   * @return the generated element
   */
  @SuppressWarnings("unchecked")
  private Element createLine(OFC ofc, int s) {
    LineChart e = new LineChart();

    if (ofc.getPallete() != null) {
      e.setColour(ofc.getPallete()[s]);
    } else {
      e.setColour("#E2D66A");
    }
    Comparable serie = model.getSeries(s);
    e.setText((String) serie);
    List<Dot> values = new ArrayList<Dot>();
    for (Iterator itCategories = model.getCategories().iterator(); itCategories
        .hasNext();) {
      Comparable category = (Comparable) itCategories.next();
      Number value = model.getValue(serie, category);
      Dot d = new Dot(value);
      d.setDotSize(1);
      values.add(d);
    }
    e.addDots(values);
    return e;
  }
View Full Code Here

    List<Dot> values = new ArrayList<Dot>();
    for (Iterator itCategories = model.getCategories().iterator(); itCategories
        .hasNext();) {
      Comparable category = (Comparable) itCategories.next();
      Number value = model.getValue(serie, category);
      Dot d = new Dot(value);
      d.setDotSize(1);
      values.add(d);
    }
    e.addDots(values);
    return e;
  }
View Full Code Here

   *
   * @return the generated element
   */
  @SuppressWarnings("unchecked")
  protected List<Element> createElements(OFC ofc, CategoryModel model) {
    PieChart e = new PieChart();

    if (ofc.getPallete() != null) {
      e.setColours(ofc.getPallete());
    }
    e.setGradientFill(true);
    // If the model have more than one series, only the first is used
    Comparable serie = model.getSeries(0);
    e.setText((String) serie);
    for (Iterator itCategories = model.getCategories().iterator(); itCategories
        .hasNext();) {
      Comparable category = (Comparable) itCategories.next();
      Number value = model.getValue(serie, category);
      e.addSlice(value, value.toString());
    }
    List<Element> elements = new ArrayList<Element>();
    elements.add(e);
    return elements;
  }
View Full Code Here

TOP

Related Classes of jofc2.model.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.