Index: java/org/orbeon/oxf/processor/converter/chart-converter-chart.rng
===================================================================
RCS file: /cvsroot/ops/orbeon/src/java/org/orbeon/oxf/processor/converter/chart-converter-chart.rng,v
retrieving revision 1.2
diff -u -r1.2 chart-converter-chart.rng
--- java/org/orbeon/oxf/processor/converter/chart-converter-chart.rng	6 May 2008 02:18:40 -0000	1.2
+++ java/org/orbeon/oxf/processor/converter/chart-converter-chart.rng	28 Oct 2008 10:40:37 -0000
@@ -163,6 +163,52 @@
                     </element>
                 </optional>
 
+                <optional>
+                    <element name="item-label">
+                        <data type="boolean"/>
+                    </element>
+                </optional>
+
+                <optional>
+                    <element name="shape">
+                        <data type="boolean"/>
+                    </element>
+                </optional>
+
+               <zeroOrMore>
+                <optional>
+                    <element name="rangemarker">
+                        <attribute name="lowestvalue">
+                            <data type="double"/>
+                        </attribute>
+                        <attribute name="highestvalue">
+                            <data type="double"/>
+                        </attribute>
+                        <optional>
+                            <attribute name="label">
+                                <data type="string"/>
+                            </attribute>
+                        </optional>
+                        <optional>
+                            <attribute name="color">
+                                <ref name="color"/>
+                            </attribute>
+                        </optional>
+                    </element>
+                </optional>
+                </zeroOrMore>
+
+                <optional>
+                    <element name="y-axis-range">
+                        <attribute name="lowestvalue">
+                            <data type="double"/>
+                        </attribute>
+                        <attribute name="highestvalue">
+                            <data type="double"/>
+                        </attribute>
+                    </element>
+                </optional>
+
             </interleave>
         </element>
     </define>
Index: java/org/orbeon/oxf/processor/serializer/legacy/JFreeChartSerializer.java
===================================================================
RCS file: /cvsroot/ops/orbeon/src/java/org/orbeon/oxf/processor/serializer/legacy/JFreeChartSerializer.java,v
retrieving revision 1.7
diff -u -r1.7 JFreeChartSerializer.java
--- java/org/orbeon/oxf/processor/serializer/legacy/JFreeChartSerializer.java	19 Aug 2008 22:59:24 -0000	1.7
+++ java/org/orbeon/oxf/processor/serializer/legacy/JFreeChartSerializer.java	28 Oct 2008 10:40:37 -0000
@@ -13,6 +13,10 @@
  */
 package org.orbeon.oxf.processor.serializer.legacy;
 
+import org.apache.log4j.Logger;
+import org.orbeon.oxf.util.LoggerFactory;
+
+
 import org.dom4j.Document;
 import org.dom4j.Element;
 import org.dom4j.Node;
@@ -41,6 +45,10 @@
 import org.jfree.data.xy.XYSeriesCollection;
 import org.jfree.ui.RectangleEdge;
 import org.jfree.ui.RectangleInsets;
+import org.jfree.ui.Layer;
+import org.jfree.ui.RectangleAnchor;
+import org.jfree.ui.TextAnchor;
+
 import org.orbeon.oxf.common.OXFException;
 import org.orbeon.oxf.pipeline.api.PipelineContext;
 import org.orbeon.oxf.processor.ProcessorInput;
@@ -59,6 +67,8 @@
 
 public class JFreeChartSerializer extends HttpBinarySerializer {
 
+    static public Logger logger = LoggerFactory.createLogger(JFreeChartSerializer.class);
+
     public static final String CHART_CONVERTER_CHART_NAMESPACE_URI = "http://www.orbeon.com/oxf/converter/chart-chart";
 
     public static String DEFAULT_CONTENT_TYPE = "image/png";
@@ -330,6 +340,45 @@
                     el.attributeValue("exploded-percents"),
                     color);
         }
+
+        Boolean itemLabelVis = XPathUtils.selectBooleanValue(doc, "/chart/item-label");
+        logger.debug("Me ha llegado visibilidad de las etiquetas: " + itemLabelVis);
+        chart.setItemLabelVisible(itemLabelVis.booleanValue());
+        
+        Boolean shapeVis = XPathUtils.selectBooleanValue(doc, "/chart/shape");
+        logger.debug("Me ha llegado visibilidad de las formas: " + shapeVis);
+        chart.setShapeVisible(shapeVis.booleanValue());
+
+        for (Iterator i = XPathUtils.selectIterator(doc, "/chart/*[name()='rangemarker']"); i.hasNext();) {
+            Element el = (Element) i.next();
+            String c = el.attributeValue("color");
+            Paint color;
+
+            if (c != null) {
+                color = getRGBColor(c);
+                chart.addRangeMarker(el.attributeValue("label"),
+                    Double.valueOf(el.attributeValue("lowestvalue")),
+                    Double.valueOf(el.attributeValue("highestvalue")),
+                    color);
+            } else {
+                chart.addRangeMarker(el.attributeValue("label"),
+                    Double.valueOf(el.attributeValue("lowestvalue")),
+                    Double.valueOf(el.attributeValue("highestvalue")));
+            }
+        }
+
+        String lowestYAsString = XPathUtils.selectStringValueNormalize(doc, "/chart/y-axis-range/@lowestvalue");
+        String highestYAsString = XPathUtils.selectStringValueNormalize(doc, "/chart/y-axis-range/@highestvalue");
+
+        if (lowestYAsString != null) {
+            double lowestY = Double.parseDouble(lowestYAsString);
+            chart.setLowestY(lowestY);
+        }
+        if (highestYAsString != null) {
+            double highestY = Double.parseDouble(highestYAsString);
+            chart.setHighestY(highestY);
+        }
+
         return chart;
     }
 
@@ -523,7 +572,9 @@
 
         if (renderer != null) {
             if(renderer instanceof XYLineAndShapeRenderer) {
-                ((XYLineAndShapeRenderer) renderer).setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
+                XYLineAndShapeRenderer r=(XYLineAndShapeRenderer) renderer;
+                r.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
+                r.setBaseShapesVisible(chartConfig.isShapeVisible());
             }
             else {
                 ((CategoryItemRenderer) renderer).setBaseItemLabelGenerator(new StandardCategoryItemLabelGenerator());
@@ -531,12 +582,36 @@
             if (renderer instanceof BarRenderer)
                 ((BarRenderer) renderer).setItemMargin(chartConfig.getBarMargin());
 
+            renderer.setBaseItemLabelsVisible(chartConfig.isItemLabelVisible());
+
             int j = 0;
             for (Iterator i = chartConfig.getValueIterator(); i.hasNext();) {
                 Value v = (Value) i.next();
                 renderer.setSeriesPaint(j, v.getColor());
                 j++;
             }
+
+            if (plot instanceof XYPlot) {
+                j=0;
+                XYPlot p = (XYPlot)plot;
+                for (Iterator i = chartConfig.getRangeMarkerIterator(); i.hasNext();) {
+                    RangeMarker rm = (RangeMarker) i.next();
+                    Marker m = new IntervalMarker(rm.getLowestValue().doubleValue(), rm.getHighestValue().doubleValue());
+                    Paint c = rm.getColor();
+                    if (c!=null) m.setPaint(c);
+                    m.setLabel(rm.getLabel());
+                    m.setLabelAnchor(RectangleAnchor.RIGHT);
+                    m.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT);
+                    p.addRangeMarker(m,Layer.BACKGROUND);
+                    j++;
+                }
+                //Check range value restrictions
+                if (!chartConfig.isYAutoRange()) {
+                    ValueAxis va=p.getRangeAxis();
+                    va.setRange(chartConfig.getLowestY(),chartConfig.getHighestY());
+                }
+            }
+
         }
 
         plot.setOutlinePaint(chartConfig.getTitleColor());
@@ -597,6 +672,14 @@
         private int xSize;
         private int ySize;
 
+        private boolean itemLabel;
+        private boolean shape;
+
+        private List rangeMarkers = new ArrayList();
+
+        private double lowestY;
+        private double highestY;
+        private boolean autorangeY=true;
 
         public int getType() {
             return type;
@@ -733,6 +816,107 @@
         public void setCategoryLabelAngle(double categoryLabelAngle) {
             this.categoryLabelAngle = categoryLabelAngle;
         }
+
+        public boolean isItemLabelVisible() {
+            return itemLabel;
+        }
+
+        public void setItemLabelVisible(boolean visible) {
+            this.itemLabel = visible;
+        }
+
+        public boolean isShapeVisible() {
+            return shape;
+        }
+
+        public void setShapeVisible(boolean visible) {
+            this.shape = visible;
+        }
+
+        public void addRangeMarker(String label, Double lowestValue, Double highestValue) {
+            rangeMarkers.add(new RangeMarker(label, lowestValue, highestValue));
+        }
+
+        public void addRangeMarker(String label, Double lowestValue, Double highestValue, Paint color) {
+            rangeMarkers.add(new RangeMarker(label, lowestValue, highestValue,color));
+        }
+
+        public Iterator getRangeMarkerIterator() {
+            return rangeMarkers.iterator();
+        }
+
+        public double getLowestY() {
+            return lowestY;
+        }
+
+        public void setLowestY(double lowestY) {
+            this.lowestY = lowestY;
+            autorangeY=false;
+        }
+
+        public double getHighestY() {
+            return highestY;
+        }
+
+        public void setHighestY(double highestY) {
+            this.highestY = highestY;
+            autorangeY=false;
+        }
+
+        public boolean isYAutoRange() {
+            return autorangeY;
+        }
+    }
+
+    protected static class RangeMarker {
+        private String label;
+        private Double lowestValue;
+        private Double highestValue;
+        private Paint color;
+
+        public RangeMarker(String label, Double lowestValue, Double highestValue) {
+            this.label=label;
+            this.lowestValue=lowestValue;
+            this.highestValue=highestValue;
+        }
+        public RangeMarker(String label, Double lowestValue, Double highestValue, Paint color) {
+            this.label=label;
+            this.lowestValue=lowestValue;
+            this.highestValue=highestValue;
+            this.color=color;
+        }
+
+        public String getLabel() {
+            return label;
+        }
+
+        public void setLabel(String label) {
+            this.label = label;
+        }
+
+        public Double getLowestValue() {
+            return lowestValue;
+        }
+
+        public void setLowestValue(Double value) {
+            this.lowestValue = value;
+        }
+
+        public Double getHighestValue() {
+            return highestValue;
+        }
+
+        public void setHighestValue(Double value) {
+            this.highestValue = value;
+        }
+
+        public Paint getColor() {
+            return color;
+        }
+
+        public void setColor(Paint color) {
+            this.color = color;
+        }
     }
 
     protected static class Value {
Index: resources/apps/doc/pages/processors-charts-spreadsheets.xml
===================================================================
RCS file: /cvsroot/ops/orbeon/src/resources/apps/doc/pages/processors-charts-spreadsheets.xml,v
retrieving revision 1.5
diff -u -r1.5 processors-charts-spreadsheets.xml
--- resources/apps/doc/pages/processors-charts-spreadsheets.xml	19 Jun 2008 03:14:58 -0000	1.5
+++ resources/apps/doc/pages/processors-charts-spreadsheets.xml	28 Oct 2008 10:40:38 -0000
@@ -197,6 +197,72 @@
                         </tr>
                         <tr>
                             <th>
+                                <code>item-label</code> 
+                            </th>
+                            <td>The flag for controlling if one wants the item labels to be visible for all series of a chart. Can be 
+                                <code>true</code> or 
+                                <code>false</code> 
+                            </td>
+                        </tr>
+                        <tr>
+                            <th>
+                                <code>shape</code> 
+                            </th>
+                            <td>The flag for controlling if one wants a shape to be drawn for the data points of all series of a chart. Can be 
+                                <code>true</code> or 
+                                <code>false</code> 
+                            </td>
+                        </tr>
+                        <tr>
+                            <th>
+                                <code>rangemarker</code> 
+                            </th>
+                            <td>Defines a marker for highlighting an interval of values along the Y axis.</td> 
+                        </tr>
+                        <tr>
+                            <th>
+                                <code>rangemarker/@lowestvalue</code> 
+                            </th>
+                            <td>The lowest value of the interval of values to be marked.</td> 
+                        </tr>
+                        <tr>
+                            <th>
+                                <code>rangemarker/@highestvalue</code> 
+                            </th>
+                            <td>The highest value of the interval of values to be marked.</td> 
+                        </tr>
+                        <tr>
+                            <th>
+                                <code>rangemarker/@label</code> 
+                            </th>
+                            <td>The label to be applied to the range of values.</td> 
+                        </tr>
+                        <tr>
+                            <th>
+                                <code>rangemarker/@color</code> 
+                            </th>
+                            <td>The color to fill the range of values. The color specified will be phaded automatically by an alpha of 0.5 .</td> 
+                        </tr>
+                        <tr>
+                            <th>
+                                <code>y-axis-range</code> 
+                            </th>
+                            <td>Defines a range for the Y axis.</td> 
+                        </tr>
+                        <tr>
+                            <th>
+                                <code>y-axis-range/@lowestvalue</code> 
+                            </th>
+                            <td>The lowest value visible for the Y axis.</td> 
+                        </tr>
+                        <tr>
+                            <th>
+                                <code>y-axis-range/@highestvalue</code> 
+                            </th>
+                            <td>The highest value visible for the Y axis.</td> 
+                        </tr>
+                        <tr>
+                            <th>
                                 <code>value</code>
                             </th>
                             <td>Defines the values of the chart. At least one element must be present</td>
@@ -388,7 +454,48 @@
                                                 </zeroOrMore>
                                             </element>
                                         </optional>
-
+                <optional>
+                    <element name="item-label">
+                        <data type="boolean"/>
+                    </element>
+                </optional>
+                <optional>
+                    <element name="shape">
+                        <data type="boolean"/>
+                    </element>
+                </optional>
+               <zeroOrMore>
+                <optional>
+                    <element name="rangemarker">
+                        <attribute name="lowestvalue">
+                            <data type="double"/>
+                        </attribute>
+                        <attribute name="highestvalue">
+                            <data type="double"/>
+                        </attribute>
+                        <optional>
+                            <attribute name="label">
+                                <data type="string"/>
+                            </attribute>
+                        </optional>
+                        <optional>
+                            <attribute name="color">
+                                <ref name="color"/>
+                            </attribute>
+                        </optional>
+                    </element>
+                </optional>
+                </zeroOrMore>
+               <optional>
+                    <element name="y-axis-range">
+                        <attribute name="lowestvalue">
+                            <data type="double"/>
+                        </attribute>
+                        <attribute name="highestvalue">
+                            <data type="double"/>
+                        </attribute>
+                    </element>
+                </optional>
                                     </interleave>
                                 </element>
                             </define>
