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

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


    super(valueProperty, labelProperty);
  }

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

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

    boolean first = true;
    for (ModelData m : store.getModels()) {
      Number n = getValue(m);
      if (n == null) {
        chart.addNullValue();
      } else {
        chart.addValues(n);
        maxYValue = first ? n.doubleValue() : Math.max(maxYValue, n.doubleValue());
        minYValue = first ? n.doubleValue() : Math.min(minYValue, n.doubleValue());
        first = false;
      }
      if (xAxis != null) {
View Full Code Here


    barProvider.bind(store);
    bar.setDataProvider(barProvider);
    bar.addChartListener(listener);
    model.addChartConfig(bar);

    LineChart line = new LineChart();
    line.setAnimateOnShow(true);
    line.setText("Average");
    line.setColour("#FF0000");
    LineDataProvider lineProvider = new LineDataProvider("avgsales");
    lineProvider.bind(store);
    line.setDataProvider(lineProvider);
    model.addChartConfig(line);

    chart.setChartModel(model);

    // grid
View Full Code Here

    super(valueProperty, labelProperty);
  }

  @Override
  public void populateData(ChartConfig config) {
    LineChart chart = (LineChart) config;
    chart.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();
      }
    }

    boolean first = true;
    for (ModelData m : store.getModels()) {
      Number n = getValue(m);
      if (n == null) {
        chart.addNullValue();
      } else {
        chart.addValues(n);
        maxYValue = first ? n.doubleValue() : Math.max(maxYValue, n.doubleValue());
        minYValue = first ? n.doubleValue() : Math.min(minYValue, n.doubleValue());
        first = false;
      }
      if (xAxis != null) {
View Full Code Here

    super(valueProperty, labelProperty);
  }

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

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

    boolean first = true;
    for (ModelData m : store.getModels()) {
      Number n = getValue(m);
      if (n == null) {
        chart.addNullValue();
      } else {
        chart.addValues(n);
        maxYValue = first ? n.doubleValue() : Math.max(maxYValue, n.doubleValue());
        minYValue = first ? n.doubleValue() : Math.min(minYValue, n.doubleValue());
        first = false;
      }
      if (xAxis != null) {
View Full Code Here

    super(valueProperty, labelProperty);
  }

  @Override
  public void populateData(ChartConfig config) {
    LineChart chart = (LineChart) config;
    chart.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();
      }
    }

    boolean first = true;
    for (ModelData m : store.getModels()) {
      Number n = getValue(m);
      if (n == null) {
        chart.addNullValue();
      } else {
        chart.addValues(n);
        maxYValue = first ? n.doubleValue() : Math.max(maxYValue, n.doubleValue());
        minYValue = first ? n.doubleValue() : Math.min(minYValue, n.doubleValue());
        first = false;
      }
      if (xAxis != null) {
View Full Code Here

    super(valueProperty, labelProperty);
  }

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

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

    for (ModelData m : store.getModels()) {
      Number n = getValue(m);
      if (n == null) {
        chart.addNullValue();
      } else {
        chart.addValues(n);
        maxYValue = maxYValue == null ? n.doubleValue() : Math.max(maxYValue, n.doubleValue());
        minYValue = minYValue == null ? n.doubleValue() : Math.min(minYValue, n.doubleValue());
        if (xAxis != null) {
          xAxis.addLabels(getLabel(m));
        }
View Full Code Here

    super(valueProperty, labelProperty);
  }

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

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

    boolean first = true;
    for (ModelData m : store.getModels()) {
      Number n = getValue(m);
      if (n == null) {
        chart.addNullValue();
      } else {
        chart.addValues(n);
        maxYValue = first ? n.doubleValue() : Math.max(maxYValue, n.doubleValue());
        minYValue = first ? n.doubleValue() : Math.min(minYValue, n.doubleValue());
        first = false;
      }
      if (xAxis != null) {
View Full Code Here

    super(valueProperty, labelProperty);
  }

  @Override
  public void populateData(ChartConfig config) {
    LineChart chart = (LineChart) config;
    chart.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();
      }
    }

    boolean first = true;
    for (ModelData m : store.getModels()) {
      Number n = getValue(m);
      if (n == null) {
        chart.addNullValue();
      } else {
        chart.addValues(n);
        maxYValue = first ? n.doubleValue() : Math.max(maxYValue, n.doubleValue());
        minYValue = first ? n.doubleValue() : Math.min(minYValue, n.doubleValue());
        first = false;
      }
      if (xAxis != null) {
View Full Code Here

    super(valueProperty, labelProperty);
  }

  @Override
  public void populateData(ChartConfig config) {
    LineChart chart = (LineChart) config;
    chart.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();
      }
    }

    boolean first = true;
    for (ModelData m : store.getModels()) {
      Number n = getValue(m);
      if (n == null) {
        chart.addNullValue();
      } else {
        chart.addValues(n);
        maxYValue = first ? n.doubleValue() : Math.max(maxYValue, n.doubleValue());
        minYValue = first ? n.doubleValue() : Math.min(minYValue, n.doubleValue());
        first = false;
      }
      if (xAxis != null) {
View Full Code Here

    super(valueProperty, labelProperty);
  }

  @Override
  public void populateData(ChartConfig config) {
    LineChart chart = (LineChart) 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.addValues(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.LineChart

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.