Package com.positive.charts.data.xy

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


    }
    if (samples < 2) {
      throw new IllegalArgumentException("Requires 'samples' > 1");
    }

    final XYSeries series = new XYSeries(seriesKey);
    final double step = (end - start) / samples;
    for (int i = 0; i <= samples; i++) {
      final double x = start + (step * i);
      series.add(x, f.getValue(x));
    }
    final XYSeriesCollection collection = new XYSeriesCollection(series);
    return collection;

  }
View Full Code Here


    } else {
      return false;
    }

    for (final Iterator iter = series.iterator(); iter.hasNext();) {
      final XYSeries s = (XYSeries) iter.next();
      final List items = s.getItems();
      if (items.size() == 0) {
        continue;
      }

      int fromIndex = Collections.binarySearch(items, new XYDataItem(
          lowerBound, 0));
      if (fromIndex < 0) {
        fromIndex = -fromIndex - 2;
      }
      if (fromIndex < 0) {
        fromIndex = 0;
      }
      int toIndex = Collections.binarySearch(items, new XYDataItem(
          upperBound, 0));
      if (toIndex < 0) {
        toIndex = -toIndex;
      }
      if (toIndex >= items.size()) {
        toIndex = items.size() - 1;
      }
      final List subSeries = items.subList(fromIndex, toIndex);

      renderer.drawSeriesItems(gc, dataArea, info, this, domainAxis,
          rangeAxis, dataset, dataset.indexOf(s.getKey()), subSeries);
    }

    return true;
  }
View Full Code Here

TOP

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

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.