public Object createObject(Attributes atts) throws JRException {
      // Grab the chart from the object stack.
      StandardChartSettings chartSettings = (StandardChartSettings) digester.peek();

      // Set the text color
      String attrValue = atts.getValue(JRXmlConstants.ATTRIBUTE_textColor);
      if (attrValue != null && attrValue.length() > 0) {
        Color color = JRColorUtil.getColor(attrValue, null);
        chartSettings.setLegendColor(color);
      }

      // Set the background color
      attrValue = atts.getValue(JRXmlConstants.ATTRIBUTE_backgroundColor);
      if (attrValue != null && attrValue.length() > 0) {
        Color color = JRColorUtil.getColor(attrValue, null);
        chartSettings.setLegendBackgroundColor(color);
      }

      EdgeEnum position = EdgeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_position));
      if (position != null) {
        chartSettings.setLegendPosition(position);
      }

      return chartSettings;
    }