comparison artifacts/src/main/java/org/dive4elements/river/exports/DiagramGenerator.java @ 7122:038a04e001d7

Handle multiple processors for axis labeling. It now looks for the first processor that provides a label != null
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 24 Sep 2013 18:35:21 +0200
parents 7b88b87958ac
children 1a20738e9a21
comparison
equal deleted inserted replaced
7121:30cec9369608 7122:038a04e001d7
983 983
984 @Override 984 @Override
985 public String getDefaultChartSubtitle() { 985 public String getDefaultChartSubtitle() {
986 DiagramAttributes.Title dTitle = diagramAttributes.getSubtitle(); 986 DiagramAttributes.Title dTitle = diagramAttributes.getSubtitle();
987 if (dTitle == null) { 987 if (dTitle == null) {
988 return "Subtitle not configured in conf.xml"; 988 /* Subtitle is optional */
989 return null;
989 } 990 }
990 991
991 return dTitle.evaluate((D4EArtifact)getMaster(), context); 992 return dTitle.evaluate((D4EArtifact)getMaster(), context);
992 } 993 }
993 994
1004 return dTitle.evaluate((D4EArtifact)getMaster(), context); 1005 return dTitle.evaluate((D4EArtifact)getMaster(), context);
1005 } 1006 }
1006 1007
1007 @Override 1008 @Override
1008 protected String getDefaultYAxisLabel(String axisName) { 1009 protected String getDefaultYAxisLabel(String axisName) {
1009 Processor pr = diagramAttributes.getProcessorForAxisName(axisName); 1010 String label;
1010 return pr == null ? "" : pr.getAxisLabel(this); 1011 for (Processor pr: diagramAttributes.getProcessorsForAxisName(axisName)) {
1012 label = pr.getAxisLabel(this);
1013 if (label != null) {
1014 return label;
1015 }
1016 }
1017 return "No configured axis label";
1011 } 1018 }
1012 1019
1013 1020
1014 /** 1021 /**
1015 * Creates a list of Section for the chart's Y axes. 1022 * Creates a list of Section for the chart's Y axes.

http://dive4elements.wald.intevation.org