Package com.positive.charts.data.xy

Examples of com.positive.charts.data.xy.IntervalXYDataset


      }

      throw new IllegalArgumentException(message);
    }

    final IntervalXYDataset intervalDataset = (IntervalXYDataset) dataset;
    final double value = intervalDataset.getYValue(series, item);
    if (Double.isNaN(value)) {
      return;
    }

    double positiveBase = 0.0;
    double negativeBase = 0.0;

    for (int i = 0; i < series; i++) {
      final double v = dataset.getYValue(i, item);
      if (!Double.isNaN(v)) {
        if (v > 0) {
          positiveBase = positiveBase + v;
        } else {
          negativeBase = negativeBase + v;
        }
      }
    }

    double translatedBase;
    double translatedValue;
    final RectangleEdge edgeR = plot.getRangeAxisEdge();
    if (value > 0.0) {
      translatedBase = rangeAxis.valueToJava2D(positiveBase, dataArea,
          edgeR);
      translatedValue = rangeAxis.valueToJava2D(positiveBase + value,
          dataArea, edgeR);
    } else {
      translatedBase = rangeAxis.valueToJava2D(negativeBase, dataArea,
          edgeR);
      translatedValue = rangeAxis.valueToJava2D(negativeBase + value,
          dataArea, edgeR);
    }

    final RectangleEdge edgeD = plot.getDomainAxisEdge();
    final double startX = intervalDataset.getStartXValue(series, item);
    if (Double.isNaN(startX)) {
      return;
    }
    double translatedStartX = domainAxis.valueToJava2D(startX, dataArea,
        edgeD);

    final double endX = intervalDataset.getEndXValue(series, item);
    if (Double.isNaN(endX)) {
      return;
    }
    final double translatedEndX = domainAxis.valueToJava2D(endX, dataArea,
        edgeD);
View Full Code Here


      final int pass) {

    if (!this.getItemVisible(series, item)) {
      return;
    }
    final IntervalXYDataset intervalDataset = (IntervalXYDataset) dataset;

    double value0;
    double value1;
    if (this.useYInterval) {
      value0 = intervalDataset.getStartYValue(series, item);
      value1 = intervalDataset.getEndYValue(series, item);
    } else {
      value0 = this.base;
      value1 = intervalDataset.getYValue(series, item);
    }
    if (Double.isNaN(value0) || Double.isNaN(value1)) {
      return;
    }

    final double translatedValue0 = rangeAxis.valueToJava2D(value0,
        dataArea, plot.getRangeAxisEdge());
    final double translatedValue1 = rangeAxis.valueToJava2D(value1,
        dataArea, plot.getRangeAxisEdge());

    final RectangleEdge location = plot.getDomainAxisEdge();
    final double startX = intervalDataset.getStartXValue(series, item);
    if (Double.isNaN(startX)) {
      return;
    }
    double translatedStartX = domainAxis.valueToJava2D(startX, dataArea,
        location);

    final double endX = intervalDataset.getEndXValue(series, item);
    if (Double.isNaN(endX)) {
      return;
    }
    final double translatedEndX = domainAxis.valueToJava2D(endX, dataArea,
        location);
View Full Code Here

        final int itemCount = dataset.getItemCount(series);
        for (int item = 0; item < itemCount; item++) {

          double value;
          if (dataset instanceof IntervalXYDataset) {
            final IntervalXYDataset intervalXYData = (IntervalXYDataset) dataset;
            value = intervalXYData.getEndXValue(series, item);
          } else {
            value = dataset.getXValue(series, item);
          }
          if (!Double.isNaN(value)) {
            maximum = Math.max(maximum, value);
View Full Code Here

        final int itemCount = dataset.getItemCount(series);
        for (int item = 0; item < itemCount; item++) {

          double value;
          if (dataset instanceof IntervalXYDataset) {
            final IntervalXYDataset intervalXYData = (IntervalXYDataset) dataset;
            value = intervalXYData.getStartXValue(series, item);
          } else {
            value = dataset.getXValue(series, item);
          }
          if (!Double.isNaN(value)) {
            minimum = Math.min(minimum, value);
View Full Code Here

    double maximum = Double.NEGATIVE_INFINITY;
    final int seriesCount = dataset.getSeriesCount();
    double lvalue;
    double uvalue;
    if (includeInterval && (dataset instanceof IntervalXYDataset)) {
      final IntervalXYDataset intervalXYData = (IntervalXYDataset) dataset;
      for (int series = 0; series < seriesCount; series++) {
        final int itemCount = dataset.getItemCount(series);
        for (int item = 0; item < itemCount; item++) {
          lvalue = intervalXYData.getStartXValue(series, item);
          uvalue = intervalXYData.getEndXValue(series, item);
          minimum = Math.min(minimum, lvalue);
          maximum = Math.max(maximum, uvalue);
        }
      }
    } else {
View Full Code Here

      final int itemCount = dataset.getItemCount(series);
      for (int item = 0; item < itemCount; item++) {
        double lvalue;
        double uvalue;
        if (dataset instanceof IntervalXYDataset) {
          final IntervalXYDataset intervalXYData = (IntervalXYDataset) dataset;
          lvalue = intervalXYData.getStartYValue(series, item);
          uvalue = intervalXYData.getEndYValue(series, item);
        }
        /*
         * else if (dataset instanceof OHLCDataset) { OHLCDataset
         * highLowData = (OHLCDataset) dataset; lvalue =
         * highLowData.getLowValue(series, item); uvalue =
View Full Code Here

TOP

Related Classes of com.positive.charts.data.xy.IntervalXYDataset

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.