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; }
public Object createObject(Attributes atts) { StandardChartSettings chartSettings = (StandardChartSettings) digester.peek(); EdgeEnum position = EdgeEnum.getByName(atts.getValue(JRXmlConstants.ATTRIBUTE_position)); if (position != null) { chartSettings.setTitlePosition(position); } Color color = JRColorUtil.getColor(atts.getValue(JRXmlConstants.ATTRIBUTE_color), Color.black); if (color != null) { chartSettings.setTitleColor(color); } return chartSettings; }