[Schmitzm-commits] r717 - trunk/src/schmitzm/jfree/feature/style

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Feb 22 18:26:20 CET 2010


Author: mojays
Date: 2010-02-22 18:26:18 +0100 (Mon, 22 Feb 2010)
New Revision: 717

Modified:
   trunk/src/schmitzm/jfree/feature/style/FeatureChartUtil.java
Log:
Bug fixed in normalization of X-values.

Modified: trunk/src/schmitzm/jfree/feature/style/FeatureChartUtil.java
===================================================================
--- trunk/src/schmitzm/jfree/feature/style/FeatureChartUtil.java	2010-02-22 16:47:53 UTC (rev 716)
+++ trunk/src/schmitzm/jfree/feature/style/FeatureChartUtil.java	2010-02-22 17:26:18 UTC (rev 717)
@@ -223,7 +223,7 @@
 			throw new IllegalArgumentException(
 					"FeatureChartStyle must define at least 2 attributes to create XYDataset: "
 							+ attrCount);
-		String xAttrName = chartStyle.getAttributeName(0);
+		String xAttrName = chartStyle.getAttributeName(ChartStyle.DOMAIN_AXIS);
 		// check data types of X attribute
 		checkAttributeType(fc.getSchema(), xAttrName, Number.class,
 				"Domain attribute", "XYDataset");
@@ -280,10 +280,18 @@
 			Number xValue = (Number) f.getAttribute(xAttrName);
 
 			// Filter out NODATA values
-			xValue = chartStyle.filterNoDataValue(0, xValue);
+			xValue = chartStyle.filterNoDataValue(ChartStyle.DOMAIN_AXIS, xValue);
 			if (xValue == null)
 				continue;
 
+            /*
+             * Normalization of the domain axis value (if they are not
+             * handled as categories)
+             */
+            if (chartStyle.isAttributeNormalized(ChartStyle.DOMAIN_AXIS))
+                xValue = normalize(xValue, xAttrName,
+                        statisticsForNormalization);
+
 			// Determine the Y values and fill the series
 			for (int attrIdx = 1; attrIdx < attrCount; attrIdx++) {
 				String yAttrName = chartStyle.getAttributeName(attrIdx);
@@ -299,14 +307,6 @@
 					yValue = normalize(yValue, yAttrName,
 							statisticsForNormalization);
 
-				/*
-				 * Normalization of the domain axis value (if they are not
-				 * handled as categories)
-				 */
-				if (chartStyle.isAttributeNormalized(ChartStyle.DOMAIN_AXIS))
-					xValue = normalize(xValue, xAttrName,
-							statisticsForNormalization);
-
 				xySeries[attrIdx].add(xValue, yValue);
 
 				// Mapping between FID and data index in series
@@ -457,7 +457,7 @@
 			throw new IllegalArgumentException(
 					"FeatureChartStyle must define at least 2 attributes to create CategoryDataset: "
 							+ attrCount);
-		String xAttrName = chartStyle.getAttributeName(0);
+		String xAttrName = chartStyle.getAttributeName(ChartStyle.DOMAIN_AXIS);
 		// only check whether X attribute exists (numeric and not-numeric
 		// allowed)
 		checkAttributeType(fc.getSchema(), xAttrName, Comparable.class,
@@ -503,7 +503,7 @@
 						.getAttribute(xAttrName);
 
 				// Filter out NODATA values
-				catValue = chartStyle.filterNoDataValue(0, catValue);
+				catValue = chartStyle.filterNoDataValue(ChartStyle.DOMAIN_AXIS, catValue);
 
 				if (catValue == null)
 					continue;



More information about the Schmitzm-commits mailing list