Package com.extjs.gxt.charts.client.model.charts

Examples of com.extjs.gxt.charts.client.model.charts.BarChart


    super(valueProperty, labelProperty);
  }

  @Override
  public void populateData(ChartConfig config) {
    BarChart chart = (BarChart) config;
    config.getValues().clear();

    XAxis xAxis = null;
    if (labelProperty != null || labelProvider != null) {
      xAxis = chart.getModel().getXAxis();
      if (xAxis == null) {
        xAxis = new XAxis();
        chart.getModel().setXAxis(xAxis);
      } else {
        xAxis.getLabels().getLabels().clear();
      }
    }
    for (ModelData m : store.getModels()) {
      Number n = getValue(m);
      if (n == null) {
        chart.addNullValue();
      } else {
        chart.addBars(new Bar(n));
        minYValue = Math.min(minYValue, n.doubleValue());
        maxYValue = Math.max(maxYValue, n.doubleValue());
      }
      if (xAxis != null) {
        xAxis.addLabels(getLabel(m));
View Full Code Here


    super(valueProperty, labelProperty);
  }

  @Override
  public void populateData(ChartConfig config) {
    BarChart chart = (BarChart) config;
    chart.getValues().clear();

    XAxis xAxis = null;
    if (labelProperty != null) {
      xAxis = chart.getModel().getXAxis();
      if (xAxis == null) {
        xAxis = new XAxis();
        chart.getModel().setXAxis(xAxis);
      }
      xAxis.getLabels().getLabels().clear();
    }

    for (ModelData m : store.getModels()) {
      Object v = m.get(valueProperty);
      Number n = v instanceof String ? Double.parseDouble((String) v) : (Number) v;
      if (n == null) {
        n = 0;
      }
      chart.addBars(new Bar(n));
      minYValue = Math.min(minYValue, n.doubleValue());
      maxYValue = Math.max(maxYValue, n.doubleValue());
      if (xAxis != null) xAxis.addLabels(getLabel(m, valueProperty));
    }
  }
View Full Code Here

TOP

Related Classes of com.extjs.gxt.charts.client.model.charts.BarChart

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.