[Schmitzm-commits] r892 - trunk/src/schmitzm/jfree/feature/style
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Jun 3 14:37:13 CEST 2010
Author: mojays
Date: 2010-06-03 14:37:11 +0200 (Thu, 03 Jun 2010)
New Revision: 892
Modified:
trunk/src/schmitzm/jfree/feature/style/FeatureChartUtil.java
Log:
setSeriesLegendTitleAttributeName(.) for XYDataset ([schmitzm-Bugs][1516])
Modified: trunk/src/schmitzm/jfree/feature/style/FeatureChartUtil.java
===================================================================
--- trunk/src/schmitzm/jfree/feature/style/FeatureChartUtil.java 2010-06-03 12:20:11 UTC (rev 891)
+++ trunk/src/schmitzm/jfree/feature/style/FeatureChartUtil.java 2010-06-03 12:37:11 UTC (rev 892)
@@ -316,6 +316,15 @@
XYSeries xySeries = JFreeChartUtil.getOrAddSeriesFromDataset(dataset, yAttrName, false, true);
xySeries.add(xValue, yValue);
+ // If grouping series attribute is used, and a "legend title" attribute
+ // is set, overwrite the legend label in the chart style
+ if ( seriesID != null && chartStyle.getSeriesLegendTitleAttributeName() != null ) {
+ // determine the series index for the current series key
+ int seriesIdx = JFreeChartUtil.getSeriesIndexFromDataset(dataset,yAttrName);
+ // overwrite the series legend label in chart style
+ redefineSeriesLegendTitle(chartStyle, seriesIdx, f);
+ }
+
// Mapping between FID and data index in series
mapping.setMapping(f.getID(), yAttrName, datasetIdx++);
} else {
@@ -708,7 +717,7 @@
// is set, overwrite the legend label in the chart style
if ( seriesID != null && chartStyle.getSeriesLegendTitleAttributeName() != null ) {
// determine the series index for the current series key
- int seriesIdx = dataset.getRowIndex(yAttrName);
+ int seriesIdx = JFreeChartUtil.getSeriesIndexFromDataset(dataset,yAttrName);
// overwrite the series legend label in chart style
redefineSeriesLegendTitle(chartStyle, seriesIdx, f);
}
More information about the Schmitzm-commits
mailing list