[Schmitzm-commits] r670 - branches/2.0-RC2/src/schmitzm/jfree/feature/style

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Feb 3 19:57:45 CET 2010


Author: mojays
Date: 2010-02-03 19:57:43 +0100 (Wed, 03 Feb 2010)
New Revision: 670

Modified:
   branches/2.0-RC2/src/schmitzm/jfree/feature/style/FeatureChartUtil.java
Log:
BugFix in FeatureChartUtil.createXYDataset(..) : When filtering the NoDatas the feature index can no longer be used for reference in dataset (use an explicit dataset index instead)

Modified: branches/2.0-RC2/src/schmitzm/jfree/feature/style/FeatureChartUtil.java
===================================================================
--- branches/2.0-RC2/src/schmitzm/jfree/feature/style/FeatureChartUtil.java	2010-02-03 18:26:56 UTC (rev 669)
+++ branches/2.0-RC2/src/schmitzm/jfree/feature/style/FeatureChartUtil.java	2010-02-03 18:57:43 UTC (rev 670)
@@ -273,7 +273,8 @@
 			fi = new PipedFeatureIterator(fc.features());
 
 		// Iterate the FeatureCollection and fill the series
-		for (int fIdx = 0; fi.hasNext(); fIdx++) {
+		int datasetIdx = 0;
+		for (; fi.hasNext();) {
 			SimpleFeature f = fi.next();
 			// Determine X value (NULL not permitted for XYDateset!)
 			Number xValue = (Number) f.getAttribute(xAttrName);
@@ -305,7 +306,7 @@
 				xySeries[attrIdx].add(xValue, yValue);
 
 				// Mapping between FID and data index in series
-				mapping.setMapping(f.getID(), yAttrName, fIdx);
+				mapping.setMapping(f.getID(), yAttrName, datasetIdx++);
 
 				// LOGGER.debug(f.getID() + " --> "+i);
 			}



More information about the Schmitzm-commits mailing list